bchapuis commented on PR #948: URL: https://github.com/apache/incubator-baremaps/pull/948#issuecomment-2661620247
No problem. I hope the following will help clarify the steps. The natural layer is taken as an example. **Geometry Validation and Storage:** The current Java code is responsible for processing OpenStreetMap data to create valid polygons geometries for the ways and relations tagged with natural. These geometries are then stored in the PostGIS database without further simplification. This is the java class we discussed. https://github.com/apache/incubator-baremaps/blob/main/baremaps-openstreetmap/src/main/java/org/apache/baremaps/openstreetmap/function/RelationMultiPolygonBuilder.java **Simplification in the Database:** Instead of simplifying the geometries in the Java code, this is currently handled within the database. Materialized views are used to store simplified geometries. This allows to perform advanced operations (e.g. filtering, clustering, buffering, etc.) to merge nearby `natural` polygons of the same type (e.g. `forest`, etc.). https://github.com/apache/incubator-baremaps/blob/28e5bb4b9d1693d297dc849074b9126dd392ce4d/basemap/layers/natural/create.sql#L156 **Vector Tile Querying:** The materialized views containing the simplified geometries are finally queried in the tileset.js file to generate vector tiles. The variable $zoom can be used in queries to select the right table or materialized view (e.g. `osm_natural_z20`). https://github.com/apache/incubator-baremaps/blob/28e5bb4b9d1693d297dc849074b9126dd392ce4d/basemap/layers/natural/tileset.js#L23 I hope this help. Do not hesitate to ask if you need further details. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
