3 ms·
Building a robust elevation api is definitely not trivial for the average dev using the google api. If someone thought the only way to get elevations was throu
by hackula1 13y ago
Building a robust elevation api is definitely not trivial for the average dev using the google api. If someone thought the only way to get elevations was through google then they definitely will not know how to find and compile the data, then write the TIN (triangulated irregular network) algos necessary to appropriately estimate the elevation of an arbitrary point. No, it is not that hard, since tools like Grass can do a lot of the TINing stuff for you, but just running Grass, much less scripting it, is not trivial for someone unfamiliar with GIS. Making this stuff stable and performant on a server (as opposed to a one off calculation on a dataset) is also not trivial in the least.
- Doctor_Fegg 13y agoWorrying about TIN is the 10% case. Simple interpolation within SRTM raster tiles is all that's needed for 90% of cases (IMHO, obviously).
- hackula1 13y agoI would not think interpolation would be that much easier than a creating a TIN. I have not looked at the dataset though, so it might be "pre-interpolated" (probably using a TIN if I had to guess), in which case this would be pretty easy with something like pyqgis on a flask server or whatever. The entire api could basically just be: @app.route("/elevation") def elevation(): fileName = "/path/to/raster/srtmRaster.tif" fileInfo = QFileInfo(fileName) baseName = fileInfo.baseName() srtmRaster = QgsRasterLayer(fileName, baseName) res, ident = srtmRaster.identify(QgsPoint(request.form['lat'], request.form['lon'])) return ident[0] I can test this out and throw it on github with some polish if anyone is interested.