Actually google maps are cut on +-85.0511287798066 degrees of latitude.
countries900913.png looks accurate like Google.
I used same WKT as I found in geoserver's help 
(http://localhost:8080/geoserver/srsHelp.do)
But StreamingRenderer does not seem to render in '900913' google 
projection . My image looks like your second screenshot with 4326 
projection.

What am I doing wrong?
I use code given below. In simplified form it is quite short.
===========================CODE===========================
    public static void main(String[] args) throws Throwable {
//.... skipped JFrame initialization
//.... skipped data loading code
        MapContext map = new DefaultMapContext(getCRS());
//....skipped  styles creation and adding layers to context:  
map.addLayer(<<--features-->>, <<--style-->>);
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setContext(map);
        renderer.paint((Graphics2D) p.getGraphics(), new Rectangle(0, 0, 
256, 256), new ReferencedEnvelope(new Envelope(0, 180, 0, 
85.0511287798066), getCRS()));
    }

    public static CoordinateReferenceSystem getCRS() throws Throwable {
            String wkt1 = "<<--Skipped WKT of 900913 projection you can 
find it in my previous post-->>";
            return CRS.parseWKT(wkt1);
    }
===========================/CODE===========================
What should I change to reproject properly?


Andrea Aime wrote :
> Yes, definitely, you should have increasing distances.
> I have the impression you're not properly reprojecting your data,
> since what you're getting is not even a plain mercator, let alone
> the Google variant.
>
> I have attached two images, one of the world countries in 4326, the
> other in 900913, as generated by GeoServer 1.6.2 (which uses GeoTools):
> as you can see the second one is very stretched towards the poles.
> In Google you don't see this much stretch only because the tiles
> are requested between -80 and 80 degrees (latitude), so the most
> stretched part is not included in the map.
>
> Cheers
> Andrea
>

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to