[Tile-serving] [openstreetmap/osm2pgsql] osm2pgsql-replication.py updating an extracted (by polygon clip) dataset? (Discussion #1612)

Stephan notifications at github.com
Mon Jan 17 17:20:53 UTC 2022


You need to extract changes affecting your data from the diff. trim_osc.py can do this.
Below is a section from my update script which keeps an extract updated.
Use a recent version, as there was a nasty bug included.
https://github.com/Zverik/regional/blob/master/trim_osc.py

```
# start replication and db import
/usr/lib/python3-pyosmium/pyosmium-get-changes -vv --size ${UPDATE_SIZE} -f ${STATE_DIR}/sequence.state -o ${TEMP_DIR}/change.osc.gz

export PGPASSWORD=xxx
./trim_osc.py -d gis --host postgis --use osm -p osm-tools-sea.poly -v -z --password ${TEMP_DIR}/change.osc.gz ${TEMP_DIR}/change-trim.osc.gz
osm2pgsql --multi-geometry --slim --append --hstore --username osm --host postgis --database gis --expire-tiles 3-17 --expire-output ${TEMP_DIR}/expire.list --style openstreetmap-carto/openstreetmap-carto.style --tag-transform-script openstreetmap-carto/openstreetmap-carto.lua ${TEMP_DIR}/change-trim.osc.gz
./zxy2metatile <${TEMP_DIR}//expire.list | sort -u | ./osm-expconv osm 20 6 | sort -u | gzip >"${STATE_DIR}/expire.list.$(date +%s).gz"
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/discussions/1612#discussioncomment-1985063
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/repo-discussions/1612/comments/1985063 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220117/b962d069/attachment.htm>


More information about the Tile-serving mailing list