boku-ilen / geodot-plugin

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

Add a new module to read simple vector data #13

Closed kb173 closed 4 years ago

kb173 commented 4 years ago

For this issue we'll look at street data since it's relatively simple - more complex polygons will come later.

GDAL offers a lot of functionality for vector data. (https://gdal.org/api/ogrgeometry_cpp.html) We want to build a similar pipeline as with raster data for vectors:

GDAL <- Vector module (GDAL wrapper class) <- Geodot (Godot-compatible class)

Our street data seems to be a MultiLineString. We'll want to extract lines from it based on a position and a radius. In Godot, multiple types as a result make sense: PoolVector2/3Array, Curve(3D), Path.

kb173 commented 4 years ago

There's now a proof-of-concept vector module (VectorExtractor) for line data using standard C++ types. Next, this will be added to the GDNative plugin itself.

kb173 commented 4 years ago

Spatial filtering of the lines seems to be working with 00a0510! Needs to be tested more thoroughly though.

Since shapefiles aren't indexed, they're pretty inefficient to filter from (especially since our street data has over 1 million features). As discussed, we might want to test connecting to a PostGIS database instead, where we import the shapefile beforehand.

kb173 commented 4 years ago

Works in the demo with https://github.com/boku-ilen/geodot-plugin/commit/2233eaaf2994b4ab102a36842811f2fe51c83b3e! Closing, everything additional or bugs will be new issues.