0.0.5 • Published 2 years ago
osmhelper v0.0.5
osmhelper
To get better insight into the data, I wrote osmhelper. I wrote it in a very short time, please let me know if its broken For now i only tested it on Ubuntu 22.10
Prerequisites
- Docker
- Docker-compose
- nodejs (i think 16+ is safe)
- npm or yarn
Configuration
- NOTE: below folder+files are automatically created with default values after running
yarn osmhelper:init
(see below) - osmhelper/.env contains settings that can be changed.
- osmhelper/bridges_mapping.yaml contains the imposm mapping that produces the postgres tables from the OSM data
How to get it working
- Clone this repo from github
- Run
npm install
oryarn
to install dependencies - Run
yarn osmhelper:init
to setup initial configuration - Run
yarn osmhelper:start
- This can take a while, it will download docker images and start everything
- Run
yarn osmhelper:download
- This downloads the PBF file for philippines into osmhelper/data/
- Run
yarn osmhelper:imposm
- This imports the OSM data into postgres, using the mappings from osmhelper/bridges_mapping.yaml
- All tables go into the public database, for convenience.
- Run
yarn import:dpwh
- Imports raw_national_bridges_dataset_dpwh-rbi-2022-019.geojson into postgres using ogr2ogr
- Run
yarn generate
- Runs the /smhelper/generate.js script. Feel free to read/modify.
- Right now outputs to a TSV file: /smhelper/tmp.tsv that I then imported into googlesheets
- Go to http://localhost:8081 to view the postgres database in the browser
Tools used / inspiration
- https://postgis.net/ for all the database tooling
- https://github.com/sosedoff/pgweb for the web-based db viewer
- https://imposm.org/docs/imposm3/latest/tutorial.html#importing for the import tooling
- https://gdal.org/drivers/vector/pg.html for the geojson->postgres import tooling
- https://github.com/openmaptiles/openmaptiles-tools for inspiration to setup the tooling