|
| 1 | + |
| 2 | +# Theme `explore` |
| 3 | + |
| 4 | +OpenStreetMap contains an insane amount of complex data. If you want to use |
| 5 | +some of that data a first step is often to explore what's there, filter out the |
| 6 | +stuff that looks interesting, create some experimental maps, figure out what's |
| 7 | +useable and how. The topics in this theme are meant as starting points for such |
| 8 | +an exploration, they are intended for advanced OSM users. |
| 9 | + |
| 10 | +The data generated is intended to be used with an interactive tool such as QGIS |
| 11 | +to quickly display what's there in different ways. |
| 12 | + |
| 13 | +Some of these topics import quite a lot of data and do extensive |
| 14 | +post-processing, try with a smaller extract before you run them on the planet |
| 15 | +file. |
| 16 | + |
| 17 | +For some details on the contents of the generated database see the source |
| 18 | +code of the config file. |
| 19 | + |
| 20 | +## Naming |
| 21 | + |
| 22 | +All table names have the respective topic as prefix. |
| 23 | + |
| 24 | +## Updates |
| 25 | + |
| 26 | +Topics are mostly written in a way to allow updates of OSM data. But updates |
| 27 | +might take a while, so minutely updates are not possible for all of then. |
| 28 | +This should be improved upon. |
| 29 | + |
| 30 | +## Postprocessing |
| 31 | + |
| 32 | +Use `osm2pgsql-gen` with the respective config file to run SQL commands that do |
| 33 | +some postprocessing on the imported data. Without that some tables and/or |
| 34 | +columns will not be filled with data. |
| 35 | + |
| 36 | +## Optional Pre-Filtering |
| 37 | + |
| 38 | +For some topics it can make sense to pre-filter the OSM data, so that |
| 39 | +processing with osm2pgsql is faster. This is entirely optional. Each topic will |
| 40 | +show a command line using [Osmium](https://osmcode.org/osmium-tool/) that does |
| 41 | +this pre-filtering. |
| 42 | + |
| 43 | +## QGIS Config |
| 44 | + |
| 45 | +The `qgis` directory contains QGIS config files for each of the themes. They |
| 46 | +all use the [database |
| 47 | +service](https://www.postgresql.org/docs/current/libpq-pgservice.html) |
| 48 | +`explore`. Create a file `.pg_service.conf` in your home directory (if it is |
| 49 | +not already there) and add an entry like this: |
| 50 | + |
| 51 | +``` |
| 52 | +[explore] |
| 53 | +host=localhost |
| 54 | +port=5432 |
| 55 | +dbname=explore |
| 56 | +user=USERNAME |
| 57 | +password=PASSWORD |
| 58 | +``` |
| 59 | + |
| 60 | +## Topic: Coastline |
| 61 | + |
| 62 | +Explore coastline tagging. Everything tagged `natural=coastline`. |
| 63 | + |
| 64 | +Coastline ways are shown, with details if zoomed in. Pseudo-coastlines along |
| 65 | +the 180° meridian and the South Pole that have special tagging are also shown. |
| 66 | +Coastlines can only be tagged on ways. Nodes and relations with tag |
| 67 | +`natural=coastline` are shown as errors. Coastline (self-)intersections and |
| 68 | +open ends are shown as errors as well. |
| 69 | + |
| 70 | +Pre-Filtering: |
| 71 | + |
| 72 | +``` |
| 73 | +osmium tags-filter -o coastline.osm.pbf DATA.osm.pbf \ |
| 74 | + natural=coastline |
| 75 | +``` |
| 76 | + |
| 77 | +## Topic: Postcodes |
| 78 | + |
| 79 | +Explore postcodes in OSM, on POIs, buildings, and from postcode boundaries. |
| 80 | + |
| 81 | +Also generates postcode areas from points using convex hull and Voronoi |
| 82 | +decomposition. |
| 83 | + |
| 84 | +Pre-Filtering: |
| 85 | + |
| 86 | +``` |
| 87 | +osmium tags-filter -o postcodes.osm.pbf DATA.osm.pbf \ |
| 88 | + 'addr:*' r/postal_code |
| 89 | +``` |
| 90 | + |
| 91 | +## Topic: Restrictions |
| 92 | + |
| 93 | +Turn restrictions (relations tagged `type=restrictions`) for road navigation. |
| 94 | + |
| 95 | +Pre-Filtering: |
| 96 | + |
| 97 | +``` |
| 98 | +osmium tags-filter -o restrictions.osm.pbf DATA.osm.pbf \ |
| 99 | + w/highway w/amenity=parking r/type=restriction |
| 100 | +``` |
| 101 | + |
0 commit comments