[gdal-dev] ogr2ogr shape file extent reprojection

santoshamb ben.s.carlson at gmail.com
Thu Jan 8 01:28:06 EST 2009


Hi, I hope this is the right forum to post questions about ogr2ogr.

I'm currently working with shape file data sets that require me to
convert from NAD83 12N (26912) to WGS84 (4326).

At first I used ogr2ogr to convert my data, but eventually I started
using the .Net ProjNET library.  That is when I noticed something
interesting. When converting LineStrings, ogr2ogr and ProjNet yield
basically the same results up to 9 or so decimal places which is just
fine for accuracy.  Where I began to see a lot of differences between
the two was when I looked at the extent fields in the shapefile
header.

I compared the conversion from the original using ogr2ogr, projNet,
and an online utility. Lets look at my first dataset, hiking trails at
Glacier National Park.  As you can see, projNet and the applet agree
on the conversion, but ogr2ogr does not.  Any idea what might be going
on?

original
extent_minXY: POINT(246070.71157537602 5348294.8992404966)
extent_maxXY: POINT(335299.17115368985 5433384.3857774651)

Converted by ogr2ogr
extent_minXY: POINT(-114.47207378171277 48.2590055638581)
extent_maxXY: POINT(-113.22704302237705 49.001065911553816)

Converted by projNet
extent_minXY: POINT(-114.42000093021804 48.236968455873082)
extent_maxXY: POINT(-113.25327377636528 49.031328561125349)

Converted by applet
extent_minXY: POINT(-114.420001               48.236968 )
extent_maxXY: POINT(-113.253274		 49.031329 )

I'm seeing similar results with other shape files, I'll post the
details if anybody is interested.

The data set can be found here:
http://science.nature.nps.gov/nrdata/datastore.cfm?ID=45586

The online utility can found here:
http://home.hiwaay.net/~taylorc/toolbox/geodesy/datumtrans/

NettopologySuite (which uses ProjNet) can be found here:
http://code.google.com/p/nettopologysuite/

Thanks for the help,

Ben


More information about the gdal-dev mailing list