-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix aeroway in infrastructure. Add DB functions to help with append mode
- Loading branch information
Showing
10 changed files
with
169 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Running osm2pgsql in append mode | ||
|
||
---- | ||
|
||
> WARNING: The process described here is experimental and details will probably change! | ||
---- | ||
|
||
## Using manual steps | ||
|
||
This page documents differences from [MANUAL-STEPS-RUN.md](MANUAL-STEPS-RUN.md) | ||
|
||
|
||
Setup - Need to use Python venv, osmium is a requirement. Something like... | ||
|
||
```bash | ||
python -m venv venv && source venv/bin/activate | ||
cd ~/git/pgosm-flex && pip install -r requirements.txt | ||
``` | ||
|
||
|
||
Run osm2pgsql. Must use `--slim` mode without drop. | ||
|
||
|
||
```bash | ||
cd pgosm-flex/flex-config | ||
|
||
osm2pgsql --output=flex --style=./run.lua \ | ||
--slim \ | ||
-d $PGOSM_CONN \ | ||
~/pgosm-data/district-of-columbia-latest.osm.pbf | ||
``` | ||
|
||
Run the normal post-processing as you normally would. | ||
|
||
|
||
`osm2pgsql-replication` is bundled with osm2pgsql install. | ||
|
||
https://osm2pgsql.org/doc/manual.html#keeping-the-database-up-to-date-with-osm2pgsql-replication | ||
|
||
|
||
Initialize replication. | ||
|
||
|
||
```bash | ||
osm2pgsql-replication init -d $PGOSM_CONN \ | ||
--osm-file ~/pgosm-data/district-of-columbia-latest.osm.pbf | ||
``` | ||
|
||
|
||
|
||
Refresh the data. First clear out data that might violate foreign keys. Packaged | ||
in convenient procedure. | ||
|
||
|
||
```sql | ||
CALL osm.append_data_start(); | ||
``` | ||
|
||
Update the data. | ||
|
||
|
||
```bash | ||
osm2pgsql-replication update -d $PGOSM_CONN \ | ||
-- \ | ||
--output=flex --style=./run.lua \ | ||
--slim \ | ||
-d $PGOSM_CONN | ||
``` | ||
|
||
Refresh Mat views, rebuilds nested place polygon data. | ||
|
||
|
||
```sql | ||
CALL osm.append_data_finish(); | ||
``` | ||
|
||
|
||
Skip nested: | ||
|
||
```sql | ||
CALL osm.append_data_finish(skip_nested := True); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
click>=8.0.1 | ||
coverage>=6.1.2 | ||
osm2pgsql-tuner==0.0.4 | ||
osmium==3.2.0 | ||
psycopg>=3.0.3 | ||
psycopg-binary>=3.0.3 | ||
sh>=1.14.2 |
2 changes: 2 additions & 0 deletions
2
tests/expected/infrastructure_line_osm_type_subtype_count.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
aeroway|runway|2 | ||
aeroway|taxiway|1 | ||
power|cable|6 | ||
power|line|11 | ||
power|minor_line|2 |
2 changes: 2 additions & 0 deletions
2
tests/expected/infrastructure_point_osm_type_subtype_count.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
aeroway|helipad|9 | ||
aeroway|navigationaid|1 | ||
communications_tower||1 | ||
emergency_access||1 | ||
emergency_phone||16 | ||
|
6 changes: 6 additions & 0 deletions
6
tests/expected/infrastructure_polygon_osm_type_subtype_count.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters