rustprooflabs / pgosm-flex

PgOSM Flex provides high quality OpenStreetMap datasets in PostGIS (Postgres) using the osm2pgsql Flex output.
MIT License
101 stars 20 forks source link

Fix handling of nested polygons with `--update` mode #398

Closed rustprooflabs closed 3 months ago

rustprooflabs commented 4 months ago

Details

This PR addresses #397 reported by @jhon100, and other issues exposed by investigating that bug report.

Overview

Running --update append was missing the pre/post steps used by the --replication mode to avoid similar errors. The prep step is now handled in one place for both. The post step is handled in one place each due to differing code paths.

Tasks

rustprooflabs commented 3 months ago

Commands used for testing for reference:

export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=mysecretpassword

docker stop pgosm && docker build -t rustprooflabs/pgosm-flex .

docker run --name pgosm -d --rm \
    -v ~/pgosm-data:/app/output \
    -v /etc/localtime:/etc/localtime:ro \
    -e POSTGRES_USER=$POSTGRES_USER \
    -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
    -p 5433:5432 -d rustprooflabs/pgosm-flex

docker exec -it \
    pgosm python3 docker/pgosm_flex.py \
    --ram=8 \
    --region=north-america/us \
    --subregion=district-of-columbia \
    --update create

docker exec -it \
    pgosm python3 docker/pgosm_flex.py \
    --ram=8 \
    --region=north-america/us \
    --subregion=maryland \
    --update append