osm2pgsql-replication.py updating an extracted (by polygon clip) dataset? #1612
-
I used this process to load and prepare my database for updates: curl -s https://download.geofabrik.de/europe-220116.osm.pbf | \
osmium extract -p denmark_ext.geojson -F pbf -s simple -f pbf - | \
osm2pgsql --slim --prefix=denmark_ext -r pbf -
python3 osm2pgsql-replication.py init --prefix denmark_ext --server https://download.geofabrik.de/europe-updates And then update with: python3 osm2pgsql-replication.py update --prefix denmark_ext That will update with all changes in europe, which I now realize is what I have asked it for.. But, I would like to update only within the same polygon (defined by |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
osm2pgsql-replication.py can only be used with a predefined replication source. Updating a custom extract is a lot more involved. It roughly works along those lines: A. Initial import: B. Update: Repeat B for each update cycle. |
Beta Was this translation helpful? Give feedback.
-
You need to extract changes affecting your data from the diff. trim_osc.py can do this.
|
Beta Was this translation helpful? Give feedback.
osm2pgsql-replication.py can only be used with a predefined replication source.
Updating a custom extract is a lot more involved. It roughly works along those lines:
A. Initial import:
1. Download europe
2. Create extract with
osmium extract
3. Import extract with
osm2pgsql --slim
4. Keep original europe and extract around.
B. Update:
1. Update europe file using pyosium-up-to-date.
2. Create a new extract with
osmium extract
3. Create a diff file between old extract and new extract using
osmium derive-changes
4. Apply diff with
osm2pgsql -a --slim
5. Keep updated europe file and new extract around.
Repeat B for each update cycle.