[Gdal-dev] gdalwarp reprojection shift
dmbaker
dmbaker at cox.net
Thu Aug 31 10:31:48 EDT 2006
Wim,
I ran into the same issue while writing a .NET GUI front end to GdalWarp. I
too use the FWTools build of GdalWarp but was calling GdalWarp directly from
my C# code. The images were being transformed, but did not match the Public
Land Survey grid I was overlaying (NAD83 UTM Zone 14 meters to NAD27
Oklahoma North). The grid was offset a significant number of feet from the
transformed image. As hinted at in the FAQ’s at
http://proj.maptools.org/faq.html, though the FWTools build of GdalWarp has
support for datum shifting built in, if it cannot find the shift files then
the shift process is skipped.
To fix the problem I had to set several environment variables to the
location of the shift files. I looked at the FWTools startup batch file and
set the same environment variables it does. Those are:
PROJ_LIB
GEOTIFF_CSV
GDAL_DATA
You must make sure the paths to the various data files are set in these
environment variables. I am not sure all these need to be set, but for
safety I have. I hope this helps.
David
chalmet wrote:
>
> Hi Matthew, I replied yesterday, but apparently only sent it to you, so
> here is
> a resent of my problem.
>
> I actually am using FWtools (windows version)- gdalwarp is part of that.
> So,
> according to what you wrote, this version should handle the datum shift
> correctly.
>
> Is there anybody who could help me (step by step instructions would be
> extremely appreciated, as I am rather new to gdalwarp and proj4 and such)
> handle this datum shift correctly.
>
> Thanks!
> Wim.
>
> Quoting Matthew Perry <perrygeo at gmail.com>:
>
>> Wim,
>>
>> On 8/16/06, chalmet at telusplanet.net <chalmet at telusplanet.net> wrote:
>> > If I do this using gdalwarp, I have a shift of about 70 meters compared
>> to
>> my
>> > reprojected tiles in PCI and ERmapper. I use the following command for
>> gdalwarp:
>> >
>> > *******************
>> > gdalwarp -s_srs "+proj=tmerc +datum=NAD83 +x_0=500000 +lon_0=-115
>> +lat_0=0
>> > +k=0.9992" -t_srs "+proj=latlong +datum=NAD27" -rc -tr 0.000035
>> 0.000035
>> > 400113.tif 400113_latlong.tif
>> > *******************
>> >
>> > Does anybody know why this is happening. And more importantly, how
>> could I
>> make
>> > the gdalwarp tiff line up with my other tiffs, meaning avoid the 70m
>> shift?
>>
>>
>> Most likely your version of proj4 (which gdal uses for reprojecting
>> coordinates) is not built with support for datum shifts. The proj4 faq
>> is pretty helpful for this issue...
>> http://proj.maptools.org/faq.html.
>>
>> You might have to rebuild proj4 with the datum support files or you
>> can download FWTools (for win and linux) that has proj4 precompiled
>> with the datum shift files.
>> --
>> Matt Perry
>> perrygeo at gmail.com
>> http://www.perrygeo.net
>>
>
>
>
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>
>
--
View this message in context: http://www.nabble.com/gdalwarp-reprojection-shift-tf2118055.html#a6080582
Sent from the GDAL - Dev forum at Nabble.com.
More information about the Gdal-dev
mailing list