[Gdal-dev] Newbie (ogr2ogr reprojecting NZMG to NZTM)

Frank Warmerdam warmerdam at pobox.com
Tue May 29 09:23:44 EDT 2007


andrew.haywood at poyry.com wrote:
> 
> Dear List,
> 
> i am having some problems with reprojecting shapefiles from NZMG to 
> NZTM. I have copied the nzgd2kgrid0005.1gsb into the projlib directory 
> (on my Suse 10.2 installation it is in the
> 
> if i run the following command
> 
> ogr2ogr -f "ESRI Shapefile" north_island_nztm.shp 'FRWP/Active/38A08772 
> MfE_Mapping forest harvesting using MODIS satellite 
> data/GIS/LCDB2_North_Island_Forest_Classes.shp' -s_srs "+proj=nzmg 
> +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=intl 
> +datum=nzgd49 +units=m +nadgrids=nzgd2kgrid0005.1gsb +wktext" -t_srs 
> EPSG:2193
> 
> then run the following
> 
> ogrinfo -summary north_island_nztm.shpnorth_island_nztm
> 
> i get the following output. Where the datum is "Mean_Sea_Level" - which 
> i suspect is incorrect. I thought the datum should have been NZGD2000. 
> Any help would be greatly appreciated.
> 
> best regards.
> 
> 
> 
> INFO: Open of `north_island_nztm.shp'
>       using driver `ESRI Shapefile' successful.
> 
> Layer name: north_island_nztm
> Geometry: Polygon
> Feature Count: 104978
> Extent: (1518858.988989, 5392310.766727) - (2089515.826863, 6221064.447185)
> Layer SRS WKT:
> PROJCS["NZGD2000 / New Zealand Transverse Mercator",
>     GEOGCS["NZGD2000",
>         DATUM["Mean_Sea_Level",
>             SPHEROID["GRS_1980",6378137,298.257222101]],
>         PRIMEM["Greenwich",0],
>         UNIT["Degree",0.017453292519943295]],
>     PROJECTION["Transverse_Mercator"],
>     PARAMETER["latitude_of_origin",0],
>     PARAMETER["central_meridian",173],
>     PARAMETER["scale_factor",0.9996],
>     PARAMETER["false_easting",1600000],
>     PARAMETER["false_northing",10000000],
>     UNIT["Meter",1]]

Andrew,

I don't know what is going on.  When I try:

ogr2ogr north_island_nztm.shp data/esri/shape/eg_data/polygon.shp -s_srs 
"+proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=intl 
+datum=nzgd49 +units=m +nadgrids=nzgd2kgrid0005.1gsb +wktext" -t_srs EPSG:2193

I get:
warmerda at amd64[10]% cat north_island_nztm.prj
PROJCS["NZGD2000 / New Zealand Transverse 
Mercator",GEOGCS["NZGD2000",DATUM["D_NZGD_2000",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",173],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1600000],PARAMETER["false_northing",10000000],UNIT["Meter",1]]

I can't think of any obvious you would be having the problem you are.  What
version of GDAL/OGR are you using?

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list