Dennis Yavorsky ha scritto:
> 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?

I'm not sure if this will fix your problem, but that referenced
envelope you're creating is wrong, the proper world wide coordinates
for 900913 are: -20037508,20037508,-20037508,20037508 (minx,maxx,miny,maxy).

Besides that, does the original data have any srs info inside? If
not no reprojection will occorr.
Check you feature source, if the default geometry in the feature
type has no srs information set, no reprojection will occurr.

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