1

I have a question regarding geometry transformation using OGR/GDAL (or perhaps another open-source solution).

Let's say I need to transform geometry from one coordinate system to another using specific transformation method.

For instance, I want to achieve this:

  • Input: EPSG:4269
  • Output: EPSG:4326
  • Transformation: EPSG:1188 - NAD83 to WGS 84 (1) - see https://epsg.io/1188

It seems to me, the ogr2ogr doesn't allow to specify the transformation mechanism.

Or am I missing out something?

Is there perhaps another tool I can use for this task?

This functionality is supported by ArcGIS tools, but I'm looking for an open-source solution.

  • 1
    You can specify in the command line the source and target EPSG code, for example "ogr2ogr -s_srs EPSG:4269 -t_srs EPSG:4326 -f "ESRI Shapefile" destination.shp source.shp". If you need special towgs parameters than you can input the definition of the projection in the command line e.g. ogr2ogr -s_srs "the full proj.4 definitionof the projection" ... – Zoltan Jul 20 '18 at 18:58
  • Thank you Zoltan. Does it mean that I can use this string epsg-registry.org/… as s_srs, or t_srs? – Stanislav Dušek Jul 22 '18 at 20:06
  • AFAIK you can only use the proj definitions separately for the input and the output e.g. for 4269 see: spatialreference.org/ref/epsg/4269/proj4. But if you use the standard parameters it is the same if you specify only the EPSG ocde. – Zoltan Jul 23 '18 at 6:44
  • I'm not sure if I understand correctly. Does it mean that if I want to do the EPSG:1188 conversion, I need to parse the WKT from here - epsg-registry.org/… - and parse these parameters - PARAMETER["X-axis translation"...], PARAMETER["Y-axis translation"...], PARAMETER["Z-axis translation"...] ? So in this case, the towgs84 will be 0,0,0...? And if so, do I put the towgs84 parameters to the source, or target srs? – Stanislav Dušek Jul 23 '18 at 13:35
1

If you refer to EPSG:4269 by the code the following Proj4 string is used:

# NAD83
<4269> +proj=longlat +datum=NAD83 +no_defs  <>

If the result of the transformation is not correct you may have a gridshift file available https://proj4.org/usage/transformation.html and you can utilize them with ogr2ogr by giving the srs with a proj4 string instead of using the code

-t_srs "+proj=longlat +datum=NAD83 +no_defs +nadgrids=your_nadgrid_file"

With Proj4 version 5 it should be possible to write also your own transformation method. Perhaps this part of the documentation is relevant https://proj4.org/usage/transformation.html

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.