Gaby, I recommend *not* using this property because it will make everything use this order, and will break lat/lon GeoTools code in the same VM (your raster reprojections?). I wrote the same userguide link in the original draft of my email, then removed it when I realised that it is the *wrong* thing to do. The only people who should be using this link are those with urgent backwards compatibility concerns. Everyone else should not use this property; CRS.decode will ignore this property for OGC URN and OGC HTTP URI CRS identifiers. Try these with and without this property: System.out.println(CRS.decode("urn:ogc:def:crs:EPSG:2193")); System.out.println(CRS.decode("http://www.opengis.net/def/crs/EPSG/0/2193"));
The underlying concept is that NZTM is registered with EPSG as PROJCS with Northing/Easting axis order. *Doh.* But that is the way it is. For NZTM2000, x = North and y = East, and you should continue to use your original: ReferencedEnvelope envelope = new ReferencedEnvelope(xmin, xmax, miny, maxy, sourceCRS); Kind regards, Ben. On 29/07/13 13:09, gaby wrote: > So I've set the system wide default > System.setProperty("org.geotools.referencing.forceXY", "true"); > as suggested on the page referenced by Michael... I had a hell of a time > making raster reprojections work, but that did the trick. However, in that > situation I was not constructing any object "by hand" so to speak. > I did notice the inversion on NoRTHING/EASTING coordinates but I did not pay > it much attention.... > So am I right in undestanding that my NZTM envelope should be > ReferencedEnvelope envelope = new ReferencedEnvelope(miny, maxy, minx, miny, > sourceCRS); ? > gaby > > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/Need-help-reprojecting-ReferencedEnvelope-tp5069254p5069262.html > Sent from the geotools-gt2-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > GeoTools-GT2-Users mailing list > GeoTools-GT2-Users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- Ben Caradoc-Davies <ben.caradoc-dav...@csiro.au> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users