[Gdal-dev] PROJ.4 warping string ignored

Seth Price seth at pricepages.org
Tue Oct 23 10:46:03 EDT 2007


Thanks for the response. Although I don't claim to know what I'm  
doing, I'm trying to define a sphere (not the normal ellipsoid). I'm  
copying the instructions from this page, the PROJ.4 parameters are at  
the bottom in the 'Update 4' text:
http://cfis.savagexi.com/articles/2006/05/03/google-maps-deconstructed

Also, it doesn't make sense that I'm defining the same parameters,  
because if I directly use the proj utility, the output is different:

proj +proj=merc +datum=WGS84 +units=m -r << EOF
? 46 -90
? EOF
-10018754.17    5749599.55

proj +proj=merc +latts=0 +lon0=0 +k=1.0 +x0=0 +y0=0 +a=6378137.0  
+b=6378137.0 +units=m -r << EOF
? 46 -90
? EOF
-10018754.17    5780349.22

I think that gdalwarp is confusing the two commands because the image  
is shifted the same amount as the difference of these two coordinates.
Thanks,
Seth


On Oct 23, 2007, at 6:09 AM, Mateusz Loskot wrote:

> 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