|
From: Rueben S. <r_j...@ya...> - 2005-01-28 04:28:31
|
Hello, Geotools does not (yet) support the new zealand map grid projection. If we did support it, your WKT below looks correct. For some information on this projection, see the epsg guide book 7-2 (page 47 in the pdf) at: http://www.ihsenergy.com/epsg/guid7_2.html >From the epsg info, it looks like an oblique mercator projection would be closer than a transverse mercator, but neither will give you the correct calculations!!! For a list of projections implemented in geotools, see: http://docs.codehaus.org/display/GEOTOOLS/Coordinate+Transformation +Parameters For the 2.1.x development branch, the oblique mercator projection and NADCON transform can now be added to this list. Proj4 (and libproj4) implement the new zealand map grid (PJ_nzmg.c). You could use that to project your data to something geotools can use. If you have time, you could port the proj4 code to geotools. I will not have any time to start new development for the next few months, but could make time to answer any question you might have. The document: http://docs.codehaus.org/display/GEOTOOLS/How+to+add+new+projections is out of date, but the most of the concepts are the same with the new org.opengis.referencing interfaces in geotools 2.1.x. The only major difference is the handling of parameters, which I could write for you in about an hour. Typically, it takes me about 3-4 weeks of spare time to implement a new projection since I need to research, implement, document and test it. Another approach to getting this projection in geotools is to wrap the libproj4 library. I would eventually like to do this, but my knowledge of JNI is very limited (I was able to call libproj4 functions from java in a quick experiment last summer). Rueben On Thu, 2005-27-01 at 11:17 +1100, Ben Kelley wrote: > Hi. > > I am trying to work out how to create a CoordinateSystem object for > the New Zealand Map Grid (NZMG). > > A bit of searching on the web returned the WKT for the projection, > which looks like: > > PROJECTION["New_Zealand_Map_Grid"],PARAMETER["latitude_of_origin",-41],PARAMETER["central_meridian",173],PARAMETER["false_easting",2510000],PARAMETER["false_northing",6023150],UNIT["metre",1] > > If I try to do any transformations with this (i.e. after wrapping it > into a suitable PROJCS[] definition) I get a > CannotCreateTransformException. > > As my transformations work fine for other projections, it seem that > GeoTools 2 does not support "New_Zealand_Map_Grid". > > Can anyone help out here? As far as I can tell the New Zealand grid is > only roughly similar to a Transverse Mercator projection. Is this > going to be the closest I can get? > > - Ben Kelley. > |