2

I need to be able to replicate with ogr2ogr a coordinate transformation that was executed in ArcGIS for Desktop.

Both ArcGIS and ogr2ogr are based on EPSG standard definition.

There's not only one way to transform data from a reference system A to a reference system B, but many transformations are possible (T1, T2 ... Tn).

After a lot of reading i understood that EPSG codes define, among many other things, CRS (coordinate reference systems, A and B in the previous example), and possible transformation between them (T1...Tn).

When in gis one performs a coordinate transformation ArcGIS prompts the user with the choice of a transformation. On the other side ogr2ogr simply works specifying the source and destination CRS.

two questions then arise:

  • what kind of transformation does ogr2ogr performs? is it still based on the transformation defined within the epsg standard?
  • Is it possible to force ogr2ogr to use a transformation specified via an epsg code?

please keep in mind that my goal is to replicate a transformation executed in gis (thus identified by an epsg code), with a call to ogr2ogr.

migrated from stackoverflow.com May 27 '14 at 15:32

This question came from our site for professional and enthusiast programmers.

2

ogr2ogr provides 3 command line options dealing with coordinate systems

-a_srs srs_def:
    Assign an output SRS
-t_srs srs_def:
    Reproject/transform to this SRS on output
-s_srs srs_def:
    Override source SRS

The one you are looking for it -t_srs to transform, though you may also need -s_srs if your source data does not have it's coordinate system set correctly

To specify a coordinate system by an EPSG code you can use the format EPSG:nnnn

for example to transform a shapefile to EPSG 4326

ogr2ogr -f "ESRI Shapefile" output.shp input.shp -t_srs EPSG:4326 
0

Thanks a lot Jesse for the answer, My problem is that in many cases there's not just one transformation possible between a source and destination srs. i would like to specify the transformation not just the srs'.

just to give you an example:

Let's suppose i want to transform from EPSG 4265 (Italian monte Mario) to EPSG 4326 (WGS84) Several possible transformations are available such as:

EPSG 1169 EPSG 1664 EPSG 1660 ...and many many others

Since i need to copy exactly the actions that were done on ArcGis i need to be able to set the transformation that was decided there, and i can't be satisfied with simply setting the src and tgt SRS'...

Any idea if that is possible?

Thanks a lot!

Marco

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.