[Gdal-dev] problem abotu reprojection with ogr2ogr

Frank Warmerdam warmerdam at pobox.com
Tue May 8 20:52:35 EDT 2007


Lijian Shi wrote:
> Hi, everyone,
> 
>  
> 
> I have a shp file and landsat data of the same field, but these data’s 
> projections are different. The projection information of shp file is below:
> 
>  
> 
> GEOGCS["GCS_Assumed_Geographic_1",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
...
> ogr2ogr –s_srs input.prj –t_srs landsat.prj output.shp input.shp
> 
> When I put the output.shp and input.shp into ArcGIS together, there a 
> shift between two file. Dose anyone know the reason? Is there any 
> problem with my command?

Lijian,

I think the first question is to determine whether ogr2ogr is applying
the expected NAD27 to WGS84 datum correction or not.  What is the apparent
offset?  1m?  100m?  1000's of meters?

If it is 1m it might just be some sort of precision issue.  If it is
10's of meters or 100's of meters then it is likely that the NAD27 to
NAD83 datum shift isn't being applied.  If it is thousands of meters or
more than it is likely some other issue.

One technique to test if datum shift files are being applied is to
set the PROJ_DEBUG environment variable to some value. Then PROJ.4
should report each file it opens.  If it doesn't reporting opening a
file with a name like "conus" then or ntv1.gsb then it isn't even
trying to do the datum shifting.

The input NAD27 geographic coordinate system looks odd.  You might try
altering your command to use:

   ogr2ogr -s_srs NAD27 -t_srs landsat.prj output.shp input.shp

This will provide a less ambiguous declaration that the input
coordinate system in NAD27.

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