Comments (3)
This series of blog posts may be helpful.
Also, a while back I took these notes for replicating OSM data to postgresql. I haven't got around to trying to create a tile cache so no notes on that yet.
OSM to PostgreSQL
Create a persistent volume for the data
docker volume create osmdata
create the database
docker run --name osm-wa -v osmdata:/var/lib/postgresql/data -e POSTGIS_PASSWORD=shush -d openfirmware/postgres-osm
start the database (after a computer reboot)
docker start osm-wa
write the WA osm file to the database. you must have the osm file downloaded already
docker run -it --rm --link osm-wa:pg -v ~/Development/playground-osm-wa:/osmdata openfirmware/osm2pgsql -c 'osm2pgsql --create --slim --hstore --cache 12000 --number-processes 4 --database gis --username osm --password --host pg --port 5432 /osmdata/washington-180304.osm.pbf'
Open the database in psql
docker run -it --rm --link osm-wa:pg --entrypoint /bin/bash postgres:9.3.5 -c 'psql -h pg -p 5432 -U postgres postgres'
Set up Replication
Run once to initialize replication config
docker run -v ~/Development/playground-osm-wa:/osmdata yagajs/osmosis osmosis --read-replication-interval-init workingDirectory=/osmdata
Run these periodically to keep the data updated
Acquire replication data
docker run -v ~/Development/playground-osm-wa:/osmdata yagajs/osmosis osmosis --read-replication-interval workingDirectory=/osmdata --simplify-change --write-xml-change /osmdata/changes.osc.gz
Import replication data using osm2pgsql
docker run -it --rm --link osm-wa:pg -v ~/Development/playground-osm-wa:/osmdata openfirmware/osm2pgsql -c 'osm2pgsql --append --slim --database gis --username osm --password --host pg --port 5432 /osmdata/changes.osc.gz'
from ems-file-service.
This is the command I use for updating pgsql using my own custom style (filters out just the wikidata-having objects): osmosis --read-replication-interval workingDirectory=workdir2 --simplify-change --write-xml-change - | osm2pgsql --append --slim --database gis --flat-nodes nodes.bin --number-processes 8 --hstore --style wikidata.style --tag-transform-script wikidata.lua -r xml -
The style is at https://github.com/nyurik/osm-regions-server/tree/master/database
from ems-file-service.
this is done.
from ems-file-service.
Related Issues (20)
- [Meta] EMS 7.16 HOT 1
- [Meta] EMS 8.0 HOT 1
- France Departments winding order incompatible with Vega HOT 5
- Meta: rename master to main
- Upgrade to Node 16
- Upgrade all GeoJSON layers to follow RFC7946
- Remove region identifiers with values that are too common HOT 1
- Telangana and Andhra Pradesh regions names in India are incorrect
- Fix region name for GB-LND in administrative regions layer
- New Zealand EMS administrative map seems to be missing. Can this please be added? HOT 1
- "<svg onload=alert(1337)>%00"><img src=x onerror=alert`1`//"
- Fix Morocco regions label
- Upgrade to NodeJS 18
- [EMS] Include commit identifier in release artifacts
- Generate EMS File Service manifests for serverless
- [EMS] Create a minimal document for root directory
- Error Loading US Zip Codes GeoJSON file to index HOT 4
- Update ZCTAs to 2020 data
- Fix the content-type for the index.html file in the vector catalog
- Washington DC borders as County vs State are different HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ems-file-service.