centreborelli / srtm4 Goto Github PK
View Code? Open in Web Editor NEWDownload and parsing of SRTM4 elevation data
Download and parsing of SRTM4 elevation data
srtm4.srtm4(46.503,8.035)
gives for me:
srtm4.srtm4(46.503,8.035)
608.334
https://www.openstreetmap.org/?mlat=46.503&mlon=8.035#map=15/46.5030/8.0350&layers=C
is ca 2725 m above sea leavel ...
Trying to download a SRTM tile through this library gives the following error currently:
requests.exceptions.SSLError: HTTPSConnectionPool(host='srtm.csi.cgiar.org', port=443): Max retries exceeded with url: /wp-content/uploads/files/srtm_5x5/TIFF/srtm_21_05.zip (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)')))
When visiting https://srtm.csi.cgiar.org/ it looks like there is a problem with the SSL certificate that causes this. I tried setting verify=False
here but that didn't solve the issue:
r = session.get(from_url, stream=True, verify=False)
giving the following error:
ConnectionError: Response code 403 received for url https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/srtm_37_03.zip
Which makes sense since the link to the SRTM tile seems to be broken: https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/srtm_37_03.zip
and make is not available on std. windows
Installing this package doesn't seem to work on Ubuntu 18, I think it has something to do with the libtiff package (I tried installing different versions of this package but it still did not work unfortunately).
Any idea if there is an easy fix for this?
-ltiff -o bin/srtm4
src/srtm4.c:9:10: fatal error: tiffio.h: No such file or directory
#include <tiffio.h>
^~~~~~~~~~
compilation terminated.
Makefile:15: recipe for target 'bin/srtm4' failed
PLEASE ADVISE
ERROR: Failed building wheel for srtm4
Running setup.py clean for srtm4
Failed to build srtm4
Installing collected packages: srtm4
Running setup.py install for srtm4 ... error
ERROR: Command errored out with exit status 1:
command: /Users/ghasem.abdi/opt/anaconda3/bin/python3.8 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tg/3j7jy4jd3gs_69pk4m00c7sw0000gn/T/pip-install-h6i6i78q/srtm4_ba80b7fe0e044931b2a36f7990c443b5/setup.py'"'"'; file='"'"'/private/var/folders/tg/3j7jy4jd3gs_69pk4m00c7sw0000gn/T/pip-install-h6i6i78q/srtm4_ba80b7fe0e044931b2a36f7990c443b5/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/tg/3j7jy4jd3gs_69pk4m00c7sw0000gn/T/pip-record-0nvxixnl/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ghasem.abdi/opt/anaconda3/include/python3.8/srtm4
cwd: /private/var/folders/tg/3j7jy4jd3gs_69pk4m00c7sw0000gn/T/pip-install-h6i6i78q/srtm4_ba80b7fe0e044931b2a36f7990c443b5/
Complete output (55 lines):
running install
/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib
copying srtm4.py -> build/lib
running egg_info
writing srtm4.egg-info/PKG-INFO
writing dependency_links to srtm4.egg-info/dependency_links.txt
writing requirements to srtm4.egg-info/requires.txt
writing top-level names to srtm4.egg-info/top_level.txt
listing git files failed - pretending there aren't any
reading manifest file 'srtm4.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'requirements.txt'
writing manifest file 'srtm4.egg-info/SOURCES.txt'
cc -std=c99 -g -O3 -DNDEBUG -DDONT_USE_TEST_MAIN -DMAIN_SRTM4 src/srtm4.c src/Geoid.o src/geoid_height_wrapper.o -lstdc++ -lz -lm -ltiff -o bin/srtm4
src/srtm4.c:9:10: fatal error: 'tiffio.h' file not found
#include <tiffio.h>
^~~~~~~~~~
1 error generated.
make: *** [bin/srtm4] Error 1
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/tg/3j7jy4jd3gs_69pk4m00c7sw0000gn/T/pip-install-h6i6i78q/srtm4_ba80b7fe0e044931b2a36f7990c443b5/setup.py", line 39, in
setup(name="srtm4",
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 68, in run
return orig.install.run(self)
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/tg/3j7jy4jd3gs_69pk4m00c7sw0000gn/T/pip-install-h6i6i78q/srtm4_ba80b7fe0e044931b2a36f7990c443b5/setup.py", line 28, in run
subprocess.check_call("make", shell=True)
File "/Users/ghasem.abdi/opt/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'make' returned non-zero exit status 2.
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/ghasem.abdi/opt/anaconda3/bin/python3.8 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tg/3j7jy4jd3gs_69pk4m00c7sw0000gn/T/pip-install-h6i6i78q/srtm4_ba80b7fe0e044931b2a36f7990c443b5/setup.py'"'"'; file='"'"'/private/var/folders/tg/3j7jy4jd3gs_69pk4m00c7sw0000gn/T/pip-install-h6i6i78q/srtm4_ba80b7fe0e044931b2a36f7990c443b5/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/tg/3j7jy4jd3gs_69pk4m00c7sw0000gn/T/pip-record-0nvxixnl/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ghasem.abdi/opt/anaconda3/include/python3.8/srtm4 Check the logs for full command output.
src/srtm4.c:9:10: fatal error: 'tiffio.h' file not found
#include <tiffio.h>
^~~~~~~~~~
I installed libtiff via homebrew: brew install libtiff, but I am getting this erroe when running pip install srtm4
Any suggestions?
SRTM4 is currently returning a 404 error:
ConnectionError: Response code 404 received for url https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/srtm_36_01.zip
When I try to go to https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/srtm_36_01.zip I get:
Sorry, the page you are looking for could not be found.
Are these permanently offline or will they go back online soon?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.