Skip to content

Commit

Permalink
[auxdata] download EGM lookups as TIFF from cdn.proj.org
Browse files Browse the repository at this point in the history
  • Loading branch information
johntruckenbrodt committed Mar 7, 2022
1 parent 2119eb3 commit 598ac39
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pyroSAR/auxdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ def dem_create(src, dst, t_srs=None, tr=None, resampling_method='bilinear', thre
threads: int, str or None
the number of threads to use. Possible values:
- Default `None`: use the value of `GDAL_NUM_THREADS` without modification.
- Default `None`: use the value of `GDAL_NUM_THREADS` without modification. If `GDAL_NUM_THREADS` is None,
multi-threading is still turned on and two threads are used, one for I/O and one for computation.
- integer value: temporarily modify `GDAL_NUM_THREADS` and reset it once done.
If 1, multithreading is turned off.
- `ALL_CPUS`: special string to use all cores/CPUs of the computer; will also temporarily
modify `GDAL_NUM_THREADS`.
geoid_convert: bool
Expand Down Expand Up @@ -340,9 +342,7 @@ def dem_create(src, dst, t_srs=None, tr=None, resampling_method='bilinear', thre
# the following line is a temporary workaround until compound EPSG codes can
# directly be used for vertical CRS transformations
# see https://github.com/OSGeo/gdal/pull/4639
gdalwarp_args['srcSRS'] = crsConvert(gdalwarp_args['srcSRS'], 'proj4') \
.replace('us_nga_egm96_15.tif', 'egm96_15.gtx') \
.replace('us_nga_egm08_25.tif', 'egm08_25.gtx')
gdalwarp_args['srcSRS'] = crsConvert(gdalwarp_args['srcSRS'], 'proj4')
else:
raise RuntimeError('geoid model not yet supported')
try:
Expand Down Expand Up @@ -977,9 +977,9 @@ def get_egm_lookup(geoid, software):
out.write(r.content)

elif software == 'PROJ':
gtx_lookup = {'EGM96': 'egm96_15/egm96_15.gtx',
'EGM2008': 'egm08_25/egm08_25.gtx'}
gtx_remote = 'https://download.osgeo.org/proj/vdatum/' + gtx_lookup[geoid]
gtx_lookup = {'EGM96': 'us_nga_egm96_15.tif',
'EGM2008': 'us_nga_egm08_25.tif'}
gtx_remote = 'https://cdn.proj.org/' + gtx_lookup[geoid]

proj_lib = os.environ.get('PROJ_LIB')
if proj_lib is not None:
Expand Down

0 comments on commit 598ac39

Please sign in to comment.