[Gdal-dev] PROJ.4 warping string ignored
Mateusz Loskot
mateusz at loskot.net
Tue Oct 23 08:09:39 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.
Seth,
In both commands, your parameters are the same.
Here is PROJ.4 definition of Mercator/WGS84 (EPSG:3395)
+proj=merc +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84
+units=m +no_defs
Ellipsoid WGS84 has the same value of a semi-axis as you're giving,
so SRS definition in your first command is equivalent of the definition
from your second command. In the latter case it's a kind of short
version.
Cheers
--
Mateusz Loskot
http://mateusz.loskot.net
More information about the Gdal-dev
mailing list