Tilo, The EPSG database, at least as transformed in GDAL .CSV files (I can't say for the original one) never includes grid, so if you want one grid to be used, you can't simply specify EPSG:XXXX but you have to use the full expanded proj.4 string with +nadgrids= +wktext
As you noted, it is essential to add the +wktext parameter. Quoting http://www.gdal.org/ogr/classOGRSpatialReference.html#f1a29550373c2c14bd11514641e58e7c : "Some parameters, such as grids, recognised by PROJ.4 may not be well understood and translated into the OGRSpatialReference model. It is possible to add the +wktext parameter which is a special keyword that OGR recognises as meaning "embed the entire PROJ.4 string in the WKT and use it literally when converting back to PROJ.4 format"." As you, I'm also skeptical about the suggestion of the wheregroup.com PDF. As far as I know and could test, "EPSG:31466 +nadgrids=/Daten/etrs89/./BETA2007.gsb" is just interpreted as plain EPSG:31466 by GDAL/OGR. Best regards, Even Le Wednesday 14 April 2010 15:14:16 Tilo Villwock, vous avez écrit : > Hey that did the trick. Seems like with EPSG codes the nadgrids parameter > is just being dropped without further notice. So it's necessary to use the > complete proj parameters for both shape files including the nadgrids and > wktext option to get the results right. With PROJ_DEGUB=1 I also noticed > that it is indeed necessary to put "./" before the grid file name, as it > otherwise looks for it in the working directory of fwtools. Anyways, cs2cs > as well as ogr2ogr work now as expected! > > Despite that, it seems like the wheregroup.com tutorial > (http://wheregroup.com/de/system/files/Transformation_mit_freien_Tools_Prax >is.pdf) wasn't right after all and from what I discovered, it makes me > wonder whether they tested their results at all or just copied from someone > else. > > Thanks a lot anyways! > > -------- Original-Nachricht -------- > > > Datum: Wed, 14 Apr 2010 13:33:58 +0200 > > Von: "Schmitz, Uwe" <[email protected]> > > An: "Tilo Villwock" <[email protected]>, [email protected] > > Betreff: AW: [gdal-dev] Re: ogr2ogr BeTA2007 grid > > > > Tilo, > > > > > > ogr2ogr -s_srs "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +y_0=0 > > > > > > +ellps=bessel > > > > > > > +nadgrids=BETA2007.gsb" -t_srs EPSG:25832 target.shp source.shp > > > > > > I used the parameters instead, but it didn't work either. In > > > fact, I think it doesn't matter since ogr2ogr looks up the > > > same parameters in its EPSG file and converts the whole > > > string to WKT anyway. So the result should be the same. > > > > > > Any other thoughts? > > > > please try to verify that the grid is read. > > Therefore set the environment variable > > PROJ_DEBUG before running ogr2org, e.g. (Windows cmd): > > > > set PROJ_DEBUG=1 > > > > Then you see if the grid is accessed at all. > > > > FYI, here is my setup for transforming coordinates > > with cs2cs from german "Gauss-Krueger stripe 3/DHDN" to > > "UTM Zone 32N/ETRS89"): > > > > cs2cs \ > > +proj=tmerc \ > > +lat_0=0 \ > > +lon_0=9 \ > > +k=1.0 \ > > +x_0=3500000 \ > > +y_0=0 \ > > +ellps=bessel \ > > +units=m \ > > +nadgrids=BETA2007.gsb \ > > +to \ > > +proj=utm \ > > +ellps=GRS80 \ > > +towgs84=0,0,0 \ > > +zone=32 > > > > Hope that helps. > > Uwe _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
