tkrajina / srtm.py

Geo elevation data parser for "The Shuttle Radar Topography Mission" data
Apache License 2.0
240 stars 57 forks source link

Inverse Distance Weighted function #37

Closed nawagers closed 6 years ago

nawagers commented 6 years ago

Implemented an Inverse Distance Weighted interpolation function in GeoElevationFile. Also added a wrapper in GeoElevationData called _IDW. Both functions are marked private currently so they are not directly added to the public API. I think InverseDistanceWeight in the GeoElevationFile could just be made public, but the _IDW function in GeoElevationData should probably be merged into get_elevation().

Both functions have docstrings and robust unittests. The unittests make use of a local tile instead of relying on the network for algorithm testing. The tests check the boundaries of the tiles to verify there are no errors.

Basic usage: elevation = myGeoElevationFile._InverseDistanceWeighted(latitude, longitude) or elevation = myGeoElevationData._IDW(latitude, longitude)