Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jmichellehu opened this issue Apr 24, 2019 · 3 comments

Comments

@jmichellehu
Copy link

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
Copy link
Contributor

Which version of gdal are you using?

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

@jmichellehu
Copy link
Author

jmichellehu commented Apr 24, 2019 via email

@oleg-alexandrov
Copy link
Member

oleg-alexandrov commented Aug 31, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants