[Gdal-dev] Grid based transformation with ogr2ogr
Frank Warmerdam
warmerdam at pobox.com
Tue May 9 11:07:39 EDT 2006
uwe.schmitz at lverma.nrw.de wrote:
> Hi folks,
>
> as a solution for the upcoming datum shift in Germany
> (from DHDN to ETRS89[=WGS84]) I'm currently experimenting
> with grid based datum shifts.
>
> After fiddling around a little bit, I accomplished to
> produce a sample grid in NTv2-Format called DHDN_ETRS89.gsb.
>
> Cs2cs works well with it. The following command-line:
>
> cs2cs +init=epsg:31466 +nadgrids=./DHDN_ETRS89.gsb \
> +to +proj=utm +datum=WGS84 +zone=32
>
> gives me correct transformation results.
>
> Now I'm trying to use ogr2ogr to transform some shape-files.
> I'm currently using FWTools1.0.0b2 under WinXP (also
> verified with GDAL1.3.1 under Unix) and my command-line
> looks like:
>
> ogr2ogr -f "ESRI Shapefile" \
> -s_srs "+init=epsg:31466 +nadgrids=DHDN_ETRS89.gsb" \
> -t_srs "+proj=utm +datum=WGS84 +zone=32" \
> out\GEW01_L.shp in\GEW01_L.shp
>
> If I set PROJ_DEBUG there are only 2 lines of
> output:
>
> pj_open_lib(proj_def.dat): call fopen(C:\PROGRA~1\FWTOOL~1.0A6\proj_lib/proj_def
> .dat) - succeeded
> pj_open_lib(epsg): call fopen(C:\PROGRA~1\FWTOOL~1.0A6\proj_lib/epsg) - succeede
> d
>
> Therefore I fear that the grid isn't used at all.
> I've also used some other -s_srs/-t_srs combination
> with no success
Uwe,
Unfortunately gdalwarp uses OGC Well Known Text as the internal coordinate
system representation and that does not include any support for grid files.
NAD27/NAD83 grid shift files are handled as a special case.
So the PROJ.4 representation is parsed and converted to WKT, and then
converted back to PROJ.4 format to do the actual coordinate transformation.
But by then the grid list is lost.
Unfortunately, there is no current way to accomplish what you want with
gdalwarp. I would encourage you to file a bug report. I think I may
make an non-standard extension or two to WKT to allow transporting some
of these values I need for PROJ.4.
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 OSGF, http://osgeo.org
More information about the Gdal-dev
mailing list