OSGeo / PROJ-data

Repository for proj datum grids (for use by PROJ 7 or later)
Other
70 stars 32 forks source link

Python error trying to run grid_tools/vertoffset_grid_to_gtiff.py #100

Closed caprieldeluca closed 1 year ago

caprieldeluca commented 1 year ago

I'm trying to convert a .gtx vertical shift grid file to Geodetic TIFF Grid (GTG) format. But I still couldn't print the script help with: _vertoffset_grid_togtiff.py -h

I've copied all scripts from the _gridtools directory to _/home/gabriel/gridtools and run:

~/grid_tools$ docker run --rm -v /home/gabriel/grid_tools:/home/gabriel/grid_tools osgeo/gdal:alpine-normal-latest python3 $PWD/vertoffset_grid_to_gtiff.py -h

It returns:

Traceback (most recent call last):
  File "/home/gabriel/grid_tools/vertoffset_grid_to_gtiff.py", line 37, in <module>
    from cloud_optimize_gtiff import generate_optimized_file
  File "/home/gabriel/grid_tools/cloud_optimize_gtiff.py", line 1, in <module>
    {"payload":{"allShortcutsEnabled":true,"fileTree":{"grid_tools":{"items":[{"name":"README.md","path":"grid_tools/README.md","contentType":"file"},{"name":"check_gtiff_grid.py","path":"grid_tools/check_gtiff_grid.py","contentType":"file"},{"name":"cloud_optimize_gtiff.py","path":"grid_tools/cloud_optimize_gtiff.py","contentType":"file"},{"name":"convert_gr3df97a.py","path":"grid_tools/convert_gr3df97a.py","contentType":"file"},{"name":"ntv2_to_gtiff.py","path":"grid_tools/ntv2_to_gtiff.py","contentType":"file"},{"name":"vertoffset_grid_to_gtiff.py","path":"grid_tools/vertoffset_grid_to_gtiff.py","contentType":"file"}]
...
Really a long long record
...
,{"name":"__init__","kind":"function","identStart":4325,"identEnd":4333,"extentStart":4321,"extentEnd":4384,"fullyQualifiedName":"IFD.__init__","identUtf16":{"start":{"lineNumber":115,"utf16Col":12},"end":{"lineNumber":115,"utf16Col":20}},"extentUtf16":{"start":{"lineNumber":115,"utf16Col":8},"end":{"lineNumber":116,"utf16Col":34}}}]}},"csrf_tokens":{"/OSGeo/PROJ-data/branches":{"post":"sv_sKbKXoC-gmkfFHY77sD9T6U6mmFIX_-yVxiM7zMnTc46a1e2In5hnZvBf9QXns-8zAG0dXhWtj1wSqp3XoQ"}}},"title":"PROJ-data/cloud_optimize_gtiff.py at master · OSGeo/PROJ-data","locale":"en"}
NameError: name 'true' is not defined

Could it have to do with not cloning the entire repository? I thought that just copying the scripts i could use the tools. Thanks for fixes and comments.

Regards, Gabriel

caprieldeluca commented 1 year ago

I'm sorry, forget this issue.

I downloaded the raw _vertoffset_grid_togtiff.py, but when I saw that I also needed _cloud_optimizegtiff.py, I simply right-clicked its link in the github _gridtools folder in the web browser and clicked Save Link As.... It saved a _cloud_optimizegtiff.py, but it has not the raw code.

Sorry for the inconvenience, Regards, Gabriel