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

gdalwarp time increase for vertical datum conversion #5414

Closed
johntruckenbrodt opened this issue Mar 7, 2022 · 4 comments
Closed

gdalwarp time increase for vertical datum conversion #5414

johntruckenbrodt opened this issue Mar 7, 2022 · 4 comments

Comments

@johntruckenbrodt
Copy link
Contributor

Expected behavior and actual behavior.

Hi. I have noticed a steep increase in compute time when converting the vertical datum of a DEM with gdalwarp. In GDAL 3.3.3 this is a matter of seconds while with GDAL 3.4.1 it takes several minutes on Windows. The difference on Ubuntu is not quite as high but it still took more than three time as long. For regular CRS conversion, e.g. to UTM, this cannot be observed.

Steps to reproduce the problem.

Linux bash only:

# download and unzip DEM tile
wget https://step.esa.int/auxdata/dem/SRTMGL1/N50E011.SRTMGL1.hgt.zip
unzip N50E011.SRTMGL1.hgt.zip

# download EGM96 model
wget https://download.osgeo.org/proj/vdatum/egm96_15/egm96_15.gtx -P $PROJ_LIB

# convert EGM96 to WGS84 heights
SRS="+proj=longlat +datum=WGS84 +geoidgrids=egm96_15.gtx +vunits=m +no_defs"
gdalwarp -t_srs "$SRS" -of GTiff N50E011.hgt dem.tif

Operating system

Ubuntu 20.04 (via WSL), Windows 10

GDAL version and provenance

four different conda environments:

  • GDAL 3.3.3, PROJ 8.2.1
    • Ubuntu: 1.5s
    • Windows: 1.5s
  • GDAL 3.4.1, PROJ 8.2.1
    • Ubuntu: 5.0s
    • Windows: 3min 13s
@rouault
Copy link
Member

rouault commented Mar 7, 2022

can you try to download https://cdn.proj.org/us_nga_egm96_15.tif instead and use +geoidgrids=us_nga_egm96_15.tif instead in your PROJ string ? There are known inefficiencies in the way the new GTX reader in PROJ proceeds, which should not be present with the TIFF reader

@johntruckenbrodt
Copy link
Contributor Author

Thanks a lot for the fast solution @rouault! Using this on Windows decreases the time to approx. 6s. This is wonderful. I now get about the same difference in time between versions as on Ubuntu. Is this difference expected?

@rouault
Copy link
Member

rouault commented Mar 7, 2022

Is this difference expected?

if your question is about the difference of runtime between GDAL 3.3.3 and GDAL 3.4.1, the later uses a more accurate way of applying the vertical offset (which might not be that visible for your use case) which has longer runtime.
About the Linux vs Windows difference with GDAL 3.4.1, this is probably related to I/O on Windows being not buffered

@johntruckenbrodt
Copy link
Contributor Author

Excellent. I was mostly interested in the difference between GDAL versions. Thanks a lot @rouault.

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

2 participants