Giter VIP home page Giter VIP logo

Comments (3)

nickpeihl avatar nickpeihl commented on July 1, 2024

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.

nyurik avatar nyurik commented on July 1, 2024

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.

thomasneirynck avatar thomasneirynck commented on July 1, 2024

this is done.

from ems-file-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.