[gdal-dev] Shift/Translate vector data within the same coordinate system

Frank Warmerdam warmerdam at pobox.com
Tue Oct 7 11:45:33 EDT 2008


Andreas Neumann wrote:
> Hi,
> 
> I wonder if ogr2ogr can translate/shift vector data within the same
> coordinate system. In Postgis I would use ST_Translate(geometry, float8,
> float8, float8) to solve my problem.
> 
> I have data that is in the swiss coordinate system (metric, scale 1:1),
> but not correctly georeferenced. All vector data should be translated
> according to a given x/y offset. The output should be again in the swiss
> coordinate system.
> 
> I looked up the documentation of ogr2ogr at
> http://www.gdal.org/ogr/ogr2ogr.html but couldn't find a way to do what I
> want.
> 
> Thanks for any hint on how to do this with ogr, if it is possible at all.

Andreas,

It should be possible to specify a -s_srs and -t_srs that match the
actual coordinate system, except using a different false easting/northing
for the source srs.  This would result in an offset in x and y similar to
the difference in false easting/northing.

You can also use the vec_tr.py sample script to apply particular
transformation to all geometries in a vector layer:

http://trac.osgeo.org/gdal/browser/trunk/gdal/swig/python/samples/vec_tr.py

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    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list