https://github.com/kumy/srtm-server
https://github.com/kumy/srtm-server
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/kumy/srtm-server
- Owner: kumy
- Created: 2017-01-11T19:25:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-07T16:56:51.000Z (almost 8 years ago)
- Last Synced: 2025-02-12T07:54:37.910Z (3 months ago)
- Language: Python
- Size: 2.91 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SRTM Server
A Flask based python REST API for the srtm module to get elevations for an area described by a lat/lon bounding box.
### To run:
pip install -r requirements.txt
python ./srtm_server.pyStarts on port 5000
### Heroku deployment
Get toolbet from here:
https://devcenter.heroku.com/articles/getting-started-with-python#set-upRun the following commands:
heroku login
virtualenv venvJust on Windows:
venv\Scripts\activate.bat
Just on *NIX:
```source venv/bin/activate```
pip install -r requirements.txt --allow-all-external
heroku create
git push heroku master
heroku ps:scale web=1
heroku openBrowser should open displaying ```"Hello World!"```
#### To make a request
Form a URL as follows:
APP_URL/api/getElevations?north=TOP_LAT&south=BOTTOM_LAT&east=RIGHT_LON&west=LEFT_LON&resolution=RES
E.g.
https://shielded-ridge-5272.herokuapp.com/api/getElevations?north=-37.7&south=-38&east=145.2&west=144.9&resolution=256
or
#### Return type
An 8 bit RBG png image height map of the area specified is returned. Each pixels value represents height above sea level in meters encoded as follows;
Height(m) = R\*255 + G + B\*100
E.g.

#### Get elevation from one coordinate pair
Form a URL as follows:
APP_URL/api/getElevation?lat=LAT&lon=LON
E.g.
http://localhost:5000/api/getElevation?lat=43.6168&lon=6.95063
79#### Get country code from one coordinate pair
Form a URL as follows:
APP_URL/api/getCountry?lat=LAT&lon=LON
E.g.
http://localhost:5000/api/getCountry?lat=43.6168&lon=6.95063
FR### Licence
The data file `polygons.properties` is available under a [Creative Commons Attribution-Share Alike License](http://creativecommons.org/licenses/by-sa/3.0/) in accordance with the license from https://github.com/bencampion/reverse-country-code. It was copied and fixed from [daveross/offline-country-reverse-geocoder](https://github.com/daveross/offline-country-reverse-geocoder)