[Gdal-dev] PROJ.4 warping string ignored

Frank Warmerdam warmerdam at pobox.com
Wed Oct 24 19:54:45 EDT 2007


Seth Price wrote:
> Hello, let me first thank everyone for the great GDAL utilities. I've 
> been getting much use out of them. However I think I've come across 
> something of a bug. Some of my PROJ.4 parameters seem to be ignored.
> 
> Here is my warping command (note the -t_srs argument):
> 
> gdalwarp -t_srs '+proj=merc +latts=0 +lon0=0 +k=1.0 +x0=0 +y0=0 
> +a=6378137.0 +b=6378137.0 +units=m' -ts 11651 16480 -te -10018754.171395 
> 5465442.183323 -9796115.189808 5780349.220256 -wm 400 -co 'TILED=YES' 
> -co 'BLOCKXSIZE=512' -co 'BLOCKYSIZE=512' -rc './N046W090_x1.tif' 
> './N046W090_x1.merc.tif'
> 
> I use the PROJ.4 library and these parameters and calculate that my 
> expected output bounds are the values I have for -te. However, the 
> output image is shifted, and results in quite a bit of black space at 
> the top of the image, and some cropped off the bottom. In fact, it gives 
> the same output image as this command would give:
> 
> gdalwarp -t_srs '+proj=merc +datum=WGS84 +units=m' -ts 11651 16480 -te 
> -10018754.171395 5465442.183323 -9796115.189808 5780349.220256 -wm 400 
> -co 'TILED=YES' -co 'BLOCKXSIZE=512' -co 'BLOCKYSIZE=512' -rc 
> './N046W090_x1.tif' './N046W090_x1.merc.tif'
> 
> (note the different -t_srs)
> 
> It looks like most of my -t_srs isn't getting passed to PROJ.4. Am I 
> doing something wrong? Is this a bug in the package? If requested, I can 
> put the source file online, but it's ~300 MB.

Seth,

I haven't been following this issue closely, but I'm getting the source
coordinate system is not on the sphere, as the destination projection is.
Assuming that is the case, PROJ.4 will default to applying a substantial
vertical in an attempt to convert from the ellipsoid to the sphere.

This is related to the last FAQ on:

   http://proj.maptools.org/faq.html

I believe the workaround will be for you to specify your output coordinate
system as '+proj=merc +a=6378137.0 +b=6378137.0 +nadgrids=@null'.

Note, you have misspelled several parameters but it doesn't matter
since their values are the defaults anyways. (latts -> lat_ts, lon0 -> lon_0).

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