[Tile-serving] [openstreetmap/osm2pgsql] WIP: Add code to generalize polygons using two different strategies (PR #1830)
Jochen Topf
notifications at github.com
Wed Dec 14 08:26:16 UTC 2022
@joto commented on this pull request.
> +
+This is part of a project to add generalization support to osm2pgsql. See
+https://osm2pgsql.org/generalization/ for more information.
+
+Generalization is currently only supported for Web Mercator (EPSG 3857). This
+is by far the most common use case, we can look at extending this later if
+needed.
+
+## Usage
+
+Run osm2pgsql as usual. This example assumes you have a table called
+`landcover` with a polygon geometry column called `geom` and a text column
+called `type` with the type of the landcover (forest, grass, etc.).
+
+Create a table `landcover_z10` with (at least) columns `geom` and `type` as
+well as integer columns `x`, and `y`. Then call this:
If you use `osm2pgsql-gen` on larger extracts or the planet you need to run it with `-D` on first import to suppress `DELETE`s, then built indexes on `x, y` and when you do updates run without the `-D`. The problem is that by default `osm2pgsql-gen` will `DELETE` all features in a tile in the output table before loading them. But when you start that for the first time, i.e. when the `PREPARE` is done, the table is empty, so even if there is an index PostgreSQL will decide not to use it. After the import you create the index and do an `ANALYZE` and then everything is fine.
This is a bit tricky, but once we put this functionality into osm2pgsql itself, we know whether we are in import or append mode and can do the right thing automatically.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1830#discussion_r1048146449
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/osm2pgsql/pull/1830/review/1216982717 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20221214/3ce17167/attachment.htm>
More information about the Tile-serving
mailing list