Cartographic generalization is the process turning detailed geographic data into more general data for smaller zoom levels or smaller scale maps. It is essential for generating good-looking, easy to interpret, and fast rendering small scale maps.
Currently osm2pgsql has almost no built-in support for generalization, usually it is done using lots of SQL magic after the initial import of the data with osm2pgsql. From September 2022 to February 2023 we are running a project funded by the Prototype Fund and the German Federal Ministry of Education and Research to add more support for generalization to osm2pgsql. This will include adding some generalization support directly to osm2pgsql but also using the capabilities of the PostgreSQL database and especially the PostGIS extension in a more easy to use fashion.
Here are the posts from Jochen’s blog describing the progress of the project:
- Generalization of OSM data
- Selection of generalization problems
- Finding representative points for polygons
- Processing architecture for generalization in osm2pgsql
- Generalizing polygons
- PostgreSQL raster experiments
- Selecting settlements to display
- Deriving built-up areas
And here are some related pull requests: