https://github.com/thgeorgiou/go-srtm
A small service written in Go for accessing SRTM elevation data
https://github.com/thgeorgiou/go-srtm
api elevation-data srtm
Last synced: 4 months ago
JSON representation
A small service written in Go for accessing SRTM elevation data
- Host: GitHub
- URL: https://github.com/thgeorgiou/go-srtm
- Owner: thgeorgiou
- License: mit
- Created: 2017-05-09T12:19:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-21T11:39:37.000Z (about 9 years ago)
- Last Synced: 2024-06-19T23:14:01.611Z (almost 2 years ago)
- Topics: api, elevation-data, srtm
- Language: Go
- Size: 15.6 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-srtm
Shuttle Radar Topography Mission (SRTM) is an international research effort to create a global digital elevation dataset. Since the data files are large I created a small web service in Go so applications can access the data without having the users download the whole database locally.
`go-srtm` only works with raw one arc-second data files (.hgt, 3601x3601). Each file should be 25,934,402 bytes.
## How to run
You can use `go get github.com/sakisds/go-srtm` to grab the sources and compile a binary. `go-srtm` doesn't have any external dependencies.
## API Documentation
### /elevation
This endpoint returns the elevation value for a set of coordinates
**Parameters**:
* `locations`: Where to look for elevation. Each point is two float numbers (latitude and longitude) separated with
a comma (`,`). You can query multiple locations in one call by separating the points with `|`, for
example `/elevation?locations=21.124,37.157|22.984,23.487` will return elevation for (21.124, 37.157)
and (22.984, 23.487).
**Returns:**: JSON Array of the requested data in meters. If data is not available at a requested point it will return
`-1`.
### /elevationPath
Returns elevation data every 30m on a path connecting two points.
**Parameters**:
* `from`: Where does the path start (latitude and longitude, comma separated)
* `to`: Where does the path end (latitude and longitude, comma separated)
**Returns**: JSON Array of elevation data.
### /tiles
Returns the list of available SRTM tiles
**Returns**: JSON Array of available SRTM files (string, no extension). For example: `["N41E021", "N41E022"]`
## Configuration
`go-srtm` will look for `config.ini` in the current path. A sample configuration file:
```ini
address = ""
port = "8080"
dataset = "/srv/srtm"
```
`dataset` should point to the directory containing the SRTM data. You can use `address` to set which IP the service
is listening on.
## License
`go-srtm` is available under the MIT license.