5

I am using gdal/ogr to transform my data from EPSG31467 to EPSG 25832. I modified the epsg-string for EPSG 31467 so it uses a NTv2-grid ("BWTA2017.gsb").

<31467> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +datum=potsdam [email protected],@BETA2007.gsb,null +units=m +no_defs

Is it possible to log if gdal/ogr really used this NTV2-grid for transformations or if it used the two other options that were set as fallback-options ("Beta2007.gsb" or null)?

I want to be able to know for each transformed file if the provided NTv2-grid was used or less accurate parameters were used instead.

EDIT1: FME for example logs the objects that are outside the valid grid extent:

2018-03-01 13:35:35|  32.2|  7.1|WARN  |Coordinate (approx) 8E:47N outside grid file coverage; fallback used.
2018-03-01 13:36:00|  55.1| 22.9|WARN  |Coordinate (approx) 7E:47N outside grid file coverage; fallback used.
2018-03-01 13:36:05|  58.8|  3.7|WARN  |Coordinate (approx) 20E:60N outside grid file coverage; fallback used.
2018-03-01 13:36:05|  58.8|  0.0|WARN  |Coordinate (approx) 23E:62N outside grid file coverage; fallback used.
2018-03-01 13:36:05|  58.8|  0.0|WARN  |Coordinate (approx) 172E:10N outside grid file coverage; fallback used.
2018-03-01 13:36:05|  58.8|  0.0|WARN  |Coordinate (approx) 63E:42N outside grid file coverage; fallback used.
2018-03-01 13:36:05|  58.8|  0.0|WARN  |Coordinate (approx) 44E:70N outside grid file coverage; fallback used.
2018-03-01 13:36:05|  58.8|  0.0|WARN  |Coordinate (approx) 51E:123N outside grid file coverage; fallback used.
2018-03-01 13:36:05|  58.8|  0.0|WARN  |Coordinate (approx) 96E:9999S outside grid file coverage; fallback used.
5
  • If you use gdal command line tools you can try to add --debug on to the command and see if iy lists more info.
    – user30184
    Commented Feb 5, 2018 at 15:27
  • I already use --debug but there is no information which grid is used
    – Thomas B
    Commented Feb 5, 2018 at 18:52
  • Run the command specifying "none" then just with beta2007.gsb and then with just BWTA2017. Optionally, remove the grid files you don't want to be used. Are they the same or different? If the data is raster, you could pull a set of test points and convert those--it will be easier to see differences.
    – mkennedy
    Commented Feb 5, 2018 at 19:25
  • This would work for single files but I have to transform several thousands of Shapefiles and Geotiffs
    – Thomas B
    Commented Feb 5, 2018 at 19:32
  • Yes, it would work for single files, that's the point. You run a test on a few files. If there are any differences, you might assume the correct grid was used and run the transform on the rest of your data.
    – user2856
    Commented Feb 6, 2018 at 4:26

1 Answer 1

1

Have you tried setting PROJ_DEBUG=on env variable? It works with cs2cs and shows details, e.g. on shift files used. Not sure how to get its output through GDAL/OGR. Maybe in addition to --debug on.

Update: ogr2ogr outputs the proj debug messages when --debug ON is used:

....
NTv2 - loading grid DHDN90
pj_open_lib(BWTA2017.gsb): call fopen(/usr/share/proj//BWTA2017.gsb) - succeeded
...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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