NeoGeographyToolkit / StereoPipeline

The NASA Ames Stereo Pipeline is a suite of automated geodesy & stereogrammetry tools designed for processing planetary imagery captured from orbiting and landed robotic explorers on other planets.
Apache License 2.0
479 stars 169 forks source link

- GDAL driver PDS does not support create - datum_convert and crs2crs2grid.py #257

Closed jmichellehu closed 10 months ago

jmichellehu commented 5 years ago

Version 2.6.1 and in development build Input command: datum_convert --input-datum NAD83 --output-datum WGS_1984 --show-grid-calc <input_dem.img> <output_dem.img>

Errors encountered:
KeyError: expects WGS84, receives WGS1984.

File "/opt/StereoPipeline/libexec/datum_convert", line 151, in getHtdpCode
    code = code_lookup[datum_clean]
KeyError: 'WGS1984'

My conditional fix in try block (line 151, in getHtdpCode):

try:
        if datum_clean=='WGS1984':
            datum_clean='WGS84'
        code = code_lookup[datum_clean]
        print(code)

Resulted in attempts to generate grid shift file:

Generating grid shift file...
Traceback (most recent call last):
  File "/opt/StereoPipeline/libexec/datum_convert", line 407, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/opt/StereoPipeline/libexec/datum_convert", line 367, in main
    (use_grid, grid_path) = createShiftFile(input_proj_string, lonlat_bounds, options, grid_path)
  File "/opt/StereoPipeline/libexec/datum_convert", line 250, in createShiftFile
    raise Exception('Failed to create grid shift file, run with --show-grid-calc to see error.')
Exception: Failed to create grid shift file, run with --show-grid-calc to see error.

And running with --show-grid-calc revealed syntax errors (Python 2) in crs2crs2grid.py script:

Generating grid shift file...
crs2crs2grid.py -griddef -109.001667 40.001667 -105.998333 36.998333 256 256 1 2000.000000 10 2000.000000 -o /filepath/to/file_temp_grid.ct2

  File "/opt/StereoPipeline/libexec/crs2crs2grid.py", line 62
    print line

Which, once parentheses added to print statements in lines 62 and 85 of crs2crs2grid.py, results in failure due to unsupported GDAL driver:

Warning: GDAL driver PDS does not support create.

VW Error: Could not write: output_dem.  Selected GDAL driver not supported.
Conversion complete!
Removing temporary files...
Finished!
ScottMcMichael commented 5 years ago

Which version of gdal are you using?

python -c "import osgeo.gdal; print(osgeo.gdal.VersionInfo());"

jmichellehu commented 5 years ago

I'm using 2030300.

Going to try the conversion with dem_geoid


J. Michelle Hu PhD student | Civil and Environmental Engineering University of Washington | Seattle, WA j hujy@oregonstate.edumhu@uw.edu

[image: https://www.linkedin.com/in/j-michelle-hu/] https://www.linkedin.com/in/j-michelle-hu/

On Tue, Apr 23, 2019 at 7:19 PM ScottMcMichael notifications@github.com wrote:

Which version of gdal are you using?

python -c "import osgeo.gdal; print(osgeo.gdal.VersionInfo());"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeoGeographyToolkit/StereoPipeline/issues/257#issuecomment-486041214, or mute the thread https://github.com/notifications/unsubscribe-auth/AKLYILN7OZARHRTOMH2O3V3PR67RHANCNFSM4HH7SPSA .

--

J. Michelle Hu PhD student | Civil and Environmental Engineering University of Washington | Seattle, WA j hujy@oregonstate.edumhu@uw.edu

[image: https://www.linkedin.com/in/j-michelle-hu/] https://www.linkedin.com/in/j-michelle-hu/

oleg-alexandrov commented 10 months ago

datum_convert has been obsoleted. It is suggested to look into latest GDAL tools for functionality that converts datums.