Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope

2013-07-28 Thread Ben Caradoc-Davies
Gaby creating an OGC URN or OGC HTTP URI CRS identifier is as simple as appending the EPSG code to the prefix as below: int epsgCode = 2193; String ogcUrn = "urn:ogc:def:crs:EPSG::" + epsgCode; String ogcHttpUri = "http://www.opengis.net/def/crs/EPSG/0/"; + epsgCode; I missed the double colon "

Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope

2013-07-28 Thread Ben Caradoc-Davies
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

Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope

2013-07-28 Thread gaby
I agree with you Ben, it is not robust at all and it gives me nightmares about other coordinate systems. I will try using the OGC urn code instead. Does anyone have a link for how to come up with the codes? Thanx Gaby -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Need-hel

Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope

2013-07-28 Thread gaby
Yes, that worked! gaby -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Need-help-reprojecting-ReferencedEnvelope-tp5069254p5069265.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ---

Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope

2013-07-28 Thread Ben Caradoc-Davies
This will cause the reprojection to work, for the wrong reasons. The underlying problem is that EPSG:2193 has Nothing/Easting axis order in the EPSG database. IMHO, everyone should be using OGC URN or OGC HTTP URI identifiers in GeoTools and thus the official EPSG axis order; let axis order amb

Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope

2013-07-28 Thread gaby
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 ha

Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope

2013-07-28 Thread Michael Bedward
Does this help Gaby ? http://docs.geotools.org/latest/userguide/library/referencing/order.html Michael On 29 July 2013 13:06, gaby wrote: > I would like to reproject a ReferencedEnvelope from NZMG to NZTM. > > My code is a follows: > ReferencedEnvelope envelope = new ReferencedEnvelope(xmin, xm

Re: [Geotools-gt2-users] [ExternalEmail] Re: Need help reprojecting ReferencedEnvelope

2013-07-28 Thread Ben Caradoc-Davies
And the full thread on Nabble: http://osgeo-org.1560.x6.nabble.com/gdal-dev-WFS-Axis-order-issue-with-projected-coordinate-system-td5038029.html -- Ben Caradoc-Davies Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre

Re: [Geotools-gt2-users] [ExternalEmail] Re: Need help reprojecting ReferencedEnvelope

2013-07-28 Thread Ben Caradoc-Davies
Oh, my. It looks like Nothing/Easting is correct: "Yes the ISO/OGC people have made my job very hard here in NZ. As NZ's leading geospatial government department LINZ is tasked with pushing OGC standards to get interoperability going. But with all of NZ's 50+ projections being defined as Northi

Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope

2013-07-28 Thread Ben Caradoc-Davies
Gaby, your sourceCRS has axis order Northing/Easting, but your envelope bounds look like Easting/Northing. It appears that EPSG:2193 is registered in the EPSG database with axis order Nothing/Easting: http://www.epsg-registry.org/ http://www.epsg-registry.org/export.htm?gml=urn:ogc:def:crs:EPSG

[Geotools-gt2-users] Need help reprojecting ReferencedEnvelope

2013-07-28 Thread gaby
I would like to reproject a ReferencedEnvelope from NZMG to NZTM. My code is a follows: ReferencedEnvelope envelope = new ReferencedEnvelope(xmin, xmax, miny, maxy, sourceCRS); In Eclipse I can see it contains the correct bounds and CRS: ReferencedEnvelope[1567451.39 : 1570650.34, 5178586.92 : 5

[Geotools-gt2-users] GeoTools 9.4 Released

2013-07-28 Thread Ian Turton
GeoTools 9.4 released The GeoTools community is pleased to announce the availability of GeoTools 9.4 for download from source forge : - geotools-