All Projects → rustprooflabs → pgosm

rustprooflabs / pgosm

Licence: MIT license
The goal of PgOSM is to make it simpler to consume OpenStreetMap data loaded from PBF file into PostGIS via osm2pgsql.

Programming Languages

lua
6591 projects
python
139335 projects - #7 most used programming language
PLpgSQL
1095 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to pgosm

osm2geojson
Tool to convert open street map xml to geojson
Stars: ✭ 17 (+6.25%)
Mutual labels:  openstreetmap-data
bety
Web-interface to the Biofuel Ecophysiological Traits and Yields Database (used by PEcAn and TERRA REF)
Stars: ✭ 14 (-12.5%)
Mutual labels:  postgis
qgis-bridge-plugin
GeoCat Bridge is a plugin for QGIS that can be used to publish geospatial (meta)data to the cloud.
Stars: ✭ 24 (+50%)
Mutual labels:  postgis
Geotrek-admin
Paths management for National Parks and Tourism organizations
Stars: ✭ 103 (+543.75%)
Mutual labels:  postgis
GeoNature-atlas
Application WEB permettant de générer des fiches espèces publiques à partir d'observations faune/flore
Stars: ✭ 40 (+150%)
Mutual labels:  postgis
Osmunda
An offline geocode library for android, powered by SQLite, using osm data. 离线地理编码Android库,基于SQLite,使用开放街道地图数据。
Stars: ✭ 37 (+131.25%)
Mutual labels:  openstreetmap-data
psycopgr
A Python wrapper of pgRouting for routing from nodes to nodes on real map.
Stars: ✭ 24 (+50%)
Mutual labels:  postgis
openpoiservice
📍 Openpoiservice is a flask application which hosts a highly customizable points of interest database derived from OpenStreetMap data.
Stars: ✭ 134 (+737.5%)
Mutual labels:  openstreetmap-data
rpostgis
rpostgis: R Interface to a 'PostGIS' Database
Stars: ✭ 60 (+275%)
Mutual labels:  postgis
java-crud-api
No description or website provided.
Stars: ✭ 24 (+50%)
Mutual labels:  postgis
mergin-db-sync
A tool for two-way synchronization between Mergin and a PostGIS database
Stars: ✭ 29 (+81.25%)
Mutual labels:  postgis
twkb
A small GO parser for the TWKB format
Stars: ✭ 17 (+6.25%)
Mutual labels:  postgis
geoflow
R engine to orchestrate and run (meta)data workflows
Stars: ✭ 28 (+75%)
Mutual labels:  postgis
osmose-backend
Part of osmose that runs the analysis, and send the results to the frontend.
Stars: ✭ 74 (+362.5%)
Mutual labels:  openstreetmap-data
kvwmap
Internet GIS Framework for MapServer with PHP
Stars: ✭ 19 (+18.75%)
Mutual labels:  postgis
lopocs
Migrated to: https://gitlab.com/Oslandia/lopocs
Stars: ✭ 78 (+387.5%)
Mutual labels:  postgis
3dcitydb-docker-postgis
3D City Database PostGIS Docker image
Stars: ✭ 37 (+131.25%)
Mutual labels:  postgis
gsky
Distributed Scalable Geospatial Data Server
Stars: ✭ 23 (+43.75%)
Mutual labels:  postgis
cloud-tileserver
Serve mapbox vectortiles via AWS stack
Stars: ✭ 48 (+200%)
Mutual labels:  postgis
timvt
PostGIS based Vector Tile server.
Stars: ✭ 113 (+606.25%)
Mutual labels:  postgis

⚠️ Use PgOSM Flex instead! ⚠️

This project is obsolete and unmaintained! Use the PgOSM Flex project instead


PgOSM: Making PostGIS + OpenStreetMap easier!

The goal of PgOSM is to make it simpler to load an OpenStreetMap .pbf file into PostGIS. The resulting data structure provides spatial analysts easier access to open-source spatial data. One focus of this project is to be easy to setup and run on low-power (e.g. non-server) hardware. The target machine for this process is a virtual machine within a consumer-grade laptop given 1GB ram and a single core processor.

See included LICENSE file for more details about licensing.

PgOSM via Docker

PgOSM is easiest deployed using the Docker image from Docker Hub. To use PgOSM without Docker, see the manual instructions (README-MANUAL.md).

Create folder for the output (~/pgosm-data), this stores the generated SQL file used to perform the PgOSM transformations and the output file from pg_dump containing the osm and pgosm schemas to load into a production database. The .osm.pbf file and associated md5are saved here. Custom templates, and custom OSM file inputs can be stored here.

mkdir ~/pgosm-data
mkdir ~/pgosm-input

To run custom transformations, place the SQL for the setup into ~/pgosm-input. The following command adds the included thematic_road transformation into the processing queue, thus into the SQL output at the end.

(Optional)

cp ~/git/pgosm/db/data/thematic_road.sql ~/pgosm-input/

To skip the default transformations, place a skip_default file into ~/pgosm-input.

(Optional)

touch ~/pgosm-input/skip_default

Start the pgosm container to make PostgreSQL/PostGIS available. This command exposes Postgres inside Docker on port 5433 and establishes links to local directories.

docker run --name pgosm -d \
    -v ~/pgosm-data:/app/output \
    -v ~/pgosm-input:/app/db/data/custom \
    -e POSTGRES_PASSWORD=mysecretpassword \
    -p 5433:5432 -d rustprooflabs/pgosm

Run the PgOSM Sub-region processing. Using the Washington D.C. sub-region is great for testing, it runs fast even on the smallest hardware.

docker exec -it \
    -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_USER=postgres \
    -e PGOSM_SCHEMA=osm_dc \
    pgosm bash docker/run_pgosm_subregion.sh \
    north-america/us \
    district-of-columbia \
    400

Skip the PgOSM processing entirely with a skip_default file and no custom files. This is helpful for developing custom transformations.

Always download

To force the processing to remove existing files and re-download the latest PBF and MD5 files from Geofabrik, set the PGOSM_ALWAYS_DOWNLOAD env var when running the Docker container.

docker run --name pgosm -d \
    -v ~/pgosm-data:/app/output \
    -v ~/pgosm-input:/app/db/data/custom \
    -e POSTGRES_PASSWORD=mysecretpassword \
    -e PGOSM_ALWAYS_DOWNLOAD=1 \
    -p 5433:5432 -d rustprooflabs/pgosm

Why use PgOSM?

Before PgOSM

When data is loaded from osm2pgsql into your database you're left with a set of three (3) planet_osm_* tables split based on type of geometry, not by type of data.

  • public.planet_osm_point
  • public.planet_osm_line
  • public.planet_osm_polygon

This means that all the data representing waterways are found in the table public.planet_osm_line. So are all the roads, sidewalks, rivers, railways, and administrative boundaries. This setup makes it impossible for an analyst used to a properly normalized relational database to simply connect to the database and be productive.

After PgOSM

When pgosm runs it creates a schema named osm and loads layer-specific data into each table. The current default configuration generates 43 tables of logically grouped data. A few examples:

  • osm.road_line
  • osm.natural_point
  • osm.building_polygon
  • osm.waterway_line

The natural_point layer, for example, contains trees, peaks, and other items with nature-related tags in OpenStreetMap.

QGIS Layer Styles

See the QGIS styles README for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].