boku-ilen / geodot-plugin

Godot plugin for loading geospatial data
GNU General Public License v3.0
109 stars 19 forks source link

Add method to get pixel values in a given geoimage #7

Closed kb173 closed 4 years ago

kb173 commented 4 years ago

For us, this is relevant for land-use data, to check whether a certain area contains a certain vegetation type, or to get a list of the most common vegetation types in that area.

We will have to make a tradeoff between accuracy and performance. I don't think iterating over all pixels is necessary for most applications, we can just take a few samples. But both options should probably be provided.

GDAL offers some of this (https://gdal.org/api/gdalrasterband_cpp.html#classGDALRasterBand), this might be worth looking into since it's probably well optimized (but probably also overkill).

kb173 commented 4 years ago

Done and exposed with https://github.com/boku-ilen/geodot-plugin/commit/faf1aa651746a274eee47f8166b830380b07c7ff, tested in LandscapeLab