From e384cda8cf3d533277d8779ffc3a7e568cccbd08 Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Thu, 23 Jul 2015 18:10:06 +0200 Subject: [PATCH] init --- docker-compose.yml | 40 ++ readme.md | 12 + settings/mapping.json | 824 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 876 insertions(+) create mode 100644 docker-compose.yml create mode 100644 readme.md create mode 100644 settings/mapping.json diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9673e09 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,40 @@ +db: + #image: postgis + build: ../docker-postgis + hostname: db + environment: + - USERNAME=docker + - PASS=docker + - HSTORE=true + # TODO: Why are exposing ports to the host? This is + # TODO: an anti-pattern - TS + ports: + - "6543:5432" + +imposm: + #image: imposm + build: ../docker-imposm3 + volumes: + - ./base-pbf:/home/base-pbf + - ./import-done:/home/import-done + - ./import-queue:/home/import-queue + - ./settings:/home/settings + - ./cache:/home/cache + links: + - db:db + environment: + - user=docker + - password=docker + - port=5432 + - host=db + - dbname=gis + +osmupdate: + #image: osmupdate + build: ../docker-osmupdate + volumes: + - ./base-pbf:/home/base-pbf + - ./import-done:/home/import-done + - ./import-queue:/home/import-queue + - ./settings:/home/settings + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..6004463 --- /dev/null +++ b/readme.md @@ -0,0 +1,12 @@ +Next to ``docker-osm`` : + +``git clone https://github.com/Gustry/docker-osmupdate.git`` +``git clone https://github.com/Gustry/docker-imposm.git`` +``git clone https://github.com/Gustry/docker-postgis.git`` + +``mkdir base-pbf import-queue import-done cache`` + +Copy a OSM file and its state file into base-pbf. + +``docker-compose build`` +``docker-compose up`` \ No newline at end of file diff --git a/settings/mapping.json b/settings/mapping.json new file mode 100644 index 0000000..7e8d786 --- /dev/null +++ b/settings/mapping.json @@ -0,0 +1,824 @@ +{ + "tables": { + "landusages": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + }, + { + "type": "pseudoarea", + "name": "area", + "key": null + }, + { + "args": { + "ranks": [ + "pedestrian", + "footway", + "playground", + "park", + "forest", + "cemetery", + "farmyard", + "farm", + "farmland", + "wood", + "meadow", + "grass", + "wetland", + "village_green", + "recreation_ground", + "garden", + "sports_centre", + "pitch", + "common", + "allotments", + "golf_course", + "university", + "school", + "college", + "library", + "baracks", + "fuel", + "parking", + "nature_reserve", + "cinema", + "theatre", + "place_of_worship", + "hospital", + "scrub", + "orchard", + "vineyard", + "zoo", + "quarry", + "residential", + "retail", + "commercial", + "industrial", + "railway", + "heath", + "island", + "land" + ] + }, + "type": "zorder", + "name": "z_order", + "key": "z_order" + } + ], + "type": "polygon", + "mapping": { + "amenity": [ + "university", + "school", + "college", + "library", + "fuel", + "parking", + "cinema", + "theatre", + "place_of_worship", + "hospital" + ], + "barrier": [ + "hedge" + ], + "leisure": [ + "park", + "garden", + "playground", + "golf_course", + "sports_centre", + "pitch", + "stadium", + "common", + "nature_reserve" + ], + "tourism": [ + "zoo" + ], + "natural": [ + "wood", + "water", + "land", + "scrub", + "wetland", + "heath" + ], + "man_made": [ + "pier" + ], + "aeroway": [ + "runway", + "taxiway" + ], + "place": [ + "island" + ], + "military": [ + "barracks" + ], + "landuse": [ + "park", + "forest", + "residential", + "retail", + "commercial", + "industrial", + "railway", + "cemetery", + "grass", + "farmyard", + "farm", + "farmland", + "orchard", + "vineyard", + "wood", + "meadow", + "village_green", + "recreation_ground", + "allotments", + "quarry" + ], + "highway": [ + "pedestrian", + "footway" + ], + "waterway": [ + "riverbank" + ] + } + }, + "buildings": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + } + ], + "type": "polygon", + "mapping": { + "building": [ + "__any__" + ] + } + }, + "amenity_areas": { + "_comment": "for testing duplicate inserts with __any__ and exact match", + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + } + ], + "type": "polygon", + "mapping": { + "building": [ + "shop" + ] + } + }, + "places": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + }, + { + "args": { + "ranks": [ + "country", + "state", + "region", + "county", + "city", + "town", + "village", + "hamlet", + "suburb", + "locality" + ] + }, + "type": "zorder", + "name": "z_order", + "key": "z_order" + }, + { + "type": "integer", + "name": "population", + "key": "population" + } + ], + "type": "point", + "mapping": { + "place": [ + "country", + "state", + "region", + "county", + "city", + "town", + "village", + "hamlet", + "suburb", + "locality" + ] + } + }, + "transport_areas": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + } + ], + "type": "polygon", + "mapping": { + "railway": [ + "station", + "platform" + ], + "aeroway": [ + "aerodrome", + "terminal", + "helipad", + "apron" + ] + } + }, + "admin": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + }, + { + "type": "integer", + "name": "admin_level", + "key": "admin_level" + } + ], + "type": "polygon", + "mapping": { + "boundary": [ + "administrative" + ] + } + }, + "aeroways": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + } + ], + "type": "linestring", + "mapping": { + "aeroway": [ + "runway", + "taxiway" + ] + } + }, + "waterways": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + } + ], + "type": "linestring", + "mapping": { + "waterway": [ + "stream", + "river", + "canal", + "drain", + "ditch" + ], + "barrier": [ + "ditch" + ] + } + }, + "barrierways": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + } + ], + "type": "linestring", + "mapping": { + "barrier": [ + "city_wall", + "fence", + "hedge", + "retaining_wall", + "wall", + "bollard", + "gate", + "spikes", + "lift_gate", + "kissing_gate", + "embankment", + "yes", + "wire_fence" + ] + } + }, + "transport_points": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + }, + { + "type": "string", + "name": "ref", + "key": "ref" + } + ], + "type": "point", + "mapping": { + "railway": [ + "station", + "halt", + "tram_stop", + "crossing", + "level_crossing", + "subway_entrance" + ], + "aeroway": [ + "aerodrome", + "terminal", + "helipad", + "gate" + ], + "highway": [ + "motorway_junction", + "turning_circle", + "bus_stop" + ] + } + }, + "amenities": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + } + ], + "type": "point", + "mapping": { + "amenity": [ + "university", + "school", + "library", + "fuel", + "hospital", + "fire_station", + "police", + "townhall" + ] + } + }, + "barrierpoints": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + } + ], + "type": "point", + "mapping": { + "barrier": [ + "block", + "bollard", + "cattle_grid", + "chain", + "cycle_barrier", + "entrance", + "horse_stile", + "gate", + "spikes", + "lift_gate", + "kissing_gate", + "fence", + "yes", + "wire_fence", + "toll_booth", + "stile" + ] + } + }, + "housenumbers_interpolated": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + }, + { + "type": "string", + "name": "addr:street", + "key": "addr:street" + }, + { + "type": "string", + "name": "addr:postcode", + "key": "addr:postcode" + }, + { + "type": "string", + "name": "addr:city", + "key": "addr:city" + }, + { + "type": "string", + "name": "addr:inclusion", + "key": "addr:inclusion" + } + ], + "type": "linestring", + "mapping": { + "addr:interpolation": [ + "__any__" + ] + } + }, + "roads": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "mapping_value", + "name": "type", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "boolint", + "name": "tunnel", + "key": "tunnel" + }, + { + "type": "boolint", + "name": "bridge", + "key": "bridge" + }, + { + "type": "direction", + "name": "oneway", + "key": "oneway" + }, + { + "type": "string", + "name": "ref", + "key": "ref" + }, + { + "type": "wayzorder", + "name": "z_order", + "key": "layer" + }, + { + "type": "string", + "name": "access", + "key": "access" + }, + { + "type": "string", + "name": "service", + "key": "service" + }, + { + "type": "mapping_key", + "name": "class", + "key": null + } + ], + "type": "linestring", + "filters": { + "exclude_tags": [ + ["area", "yes"] + ] + }, + "mappings": { + "railway": { + "mapping": { + "railway": [ + "rail", + "tram", + "light_rail", + "subway", + "narrow_gauge", + "preserved", + "funicular", + "monorail", + "disused" + ] + } + }, + "roads": { + "mapping": { + "man_made": [ + "pier", + "groyne" + ], + "highway": [ + "motorway", + "motorway_link", + "trunk", + "trunk_link", + "primary", + "primary_link", + "secondary", + "secondary_link", + "tertiary", + "tertiary_link", + "road", + "path", + "track", + "service", + "footway", + "bridleway", + "cycleway", + "steps", + "pedestrian", + "living_street", + "unclassified", + "residential", + "raceway" + ] + } + } + } + }, + "housenumbers": { + "fields": [ + { + "type": "id", + "name": "osm_id", + "key": null + }, + { + "type": "geometry", + "name": "geometry", + "key": null + }, + { + "type": "string", + "name": "name", + "key": "name" + }, + { + "type": "mapping_value", + "name": "type", + "key": null + }, + { + "type": "string", + "name": "addr:street", + "key": "addr:street" + }, + { + "type": "string", + "name": "addr:postcode", + "key": "addr:postcode" + }, + { + "type": "string", + "name": "addr:city", + "key": "addr:city" + } + ], + "type": "point", + "mapping": { + "addr:housenumber": [ + "__any__" + ] + } + } + } +}