[gdal-dev] ogr2ogr shape file extent reprojection

Frank Warmerdam warmerdam at pobox.com
Thu Jan 8 12:59:00 EST 2009


santoshamb wrote:
> 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.

Ben,

To me this suggests that ProjNet may be reprojecting the extents while
ogr2ogr is reprojecting the geometries, and recomputing the extents in the
new coordinate system.  I haven't verified ... just a guess.

I do know that ogr2ogr recomputes the extents written to a shapefile based
on the geometry ... extents are not carried along through a translation.

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    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list