[Gdal-dev] Reproject with Mapserver vs gdalwarp

Frank Warmerdam warmerdam at pobox.com
Thu Jul 26 09:16:02 EDT 2007


José Vicente Higón wrote:
> Thank you for your answer,
> I've installed gdal 1.4.0 and I've changed the file 
> gdal-1.4.0/share/gdal/pcs.csv, now I have a line like this:
> 23030,"ED50 / UTM zone 
> 30N",9001,4230,16030,9807,1,0,8801,0,9102,8802,-3,9102,8805,0.9996,9201,8806,500000,9001,8807,0,9001,-87,-98,-121,0,0,0,0
> However, I am still getting a wrong reprojected image (shifted over a hundred 
> meters).  I think the reason is because I am not specifying the nad grid 
> shift file ( in my case sped2et.gsb). Am I right?
> How can you specify to gdal for using this kind of file in reprojections?

José,

I'm sorry, I missed your specification of a nadgrids file. Generally it is
bad to specify a +towgs84 parameter and a nadgrid as it isn't absolutely
certain which will be used.

Unfortunately there is no way to update the pcs.csv file to specify a
nadgrid.  One thing that might work is to remove the above 23030 line
from pcs.csv, and add the following line at the beginning of
gdal/data/epsg.wkt (make sure this is just one line, not split on
spaces as it likely is in my email):

23030,PROJCS["UTM Zone 30, Northern Hemisphere",GEOGCS["International 1909 
(Hayford)",DATUM["unknown",SPHEROID["intl",6378388,297]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1],EXTENSION["PROJ4","+proj=utm 
+zone=30 +ellps=intl +units=m +nadgrids=sped2et.gsb +wktext +no_defs"]]

The "trick" is the EXTENSION["PROJ4","..."] block that tells GDAL/OGR to
use a particular PROJ.4 translation when converting to proj.4 format.

The epsg.wkt file is, I think, consulted if a pcs is not found in the
pcs.csv file so it is important that it be properly removed from there for
this to work.

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