├── .gitignore ├── README.md ├── Vagrantfile ├── ansible ├── _internals.yml ├── build-imposm.yml ├── everything-is-osm.yml ├── import-data.yml ├── setup-database.yml └── templates │ ├── mapping.json │ ├── pg_hba.conf.j2 │ ├── pgpass.j2 │ └── postgresql.conf.j2 ├── doc ├── qgis-screenshot.png └── tilemill-screenshot.png ├── docker ├── Makefile ├── everything-is-osm-tmpnb │ ├── Dockerfile │ ├── ansible_hosts │ ├── bootstrap_ansible.sh │ ├── docker-entrypoint.sh │ └── notebooks │ │ └── Everything is OSM.ipynb ├── everything-is-osm │ ├── Dockerfile │ ├── ansible_hosts │ ├── bootstrap_ansible.sh │ └── docker-entrypoint.sh ├── imposm3 │ ├── Dockerfile │ ├── import.sh │ └── mapping.json └── postgis │ ├── Dockerfile │ ├── docker-entrypoint.sh │ └── init-database.sh ├── init ├── bootstrap_ansible.sh └── vagrant_ansible_hosts └── variables.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant/ 2 | tmp/ 3 | 4 | docker/*/ansible/ 5 | docker/*/variables.yml 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Everything is OSM 2 | 3 | Get started with PostGIS + OpenStreetMap data in minutes. Works on Windows, 4 | Linux, and Mac. [More free time for your OSM 5 | community!](https://www.youtube.com/watch?v=StTqXEQ2l-Y&t=5s) 6 | 7 | This project uses popular [development](http://vagrantup.com/) and [system 8 | configuration](http://docs.ansible.com/) tools to build and configure a [virtual 9 | machine](https://www.virtualbox.org/), then download and import OpenStreetMap 10 | data extracts from [mapzen](https://mapzen.com/metro-extracts/) and 11 | [geofabrik](http://download.geofabrik.de/). 12 | 13 | 14 | ## Quickstart 15 | 16 | ### Requirements 17 | 18 | First, install recent versions of these: 19 | 20 | - [Vagrant](http://vagrantup.com/) 21 | - [Virtualbox](https://www.virtualbox.org/) 22 | 23 | 24 | 25 | ### Choose your extracts 26 | 27 | Decide what part of the world you want to import data for. The [metro 28 | extracts](https://mapzen.com/metro-extracts/) cover major metropolitan areas, 29 | and the [geofabrik extracts](http://download.geofabrik.de/) cover countries and 30 | international regions. 31 | 32 | 33 | **Note**: Larger volumes of data will take more time and might require more 34 | virtual machine memory to successfully import; see the section on 35 | [customizing](#customizing) for instructions on how to increase the amount of 36 | RAM if that's happening to you. Also, extremely large amounts of data (larger 37 | than a few GB) are not currently supported. 38 | 39 | 40 | Edit `variables.yml` so it contains the extracts that you want to include. For 41 | example: 42 | 43 | metro_extracts: 44 | - "austin_texas" 45 | - "barcelona_spain" 46 | - "portland_oregon" 47 | 48 | or: 49 | 50 | geofabrik_extracts: 51 | - "south-america/ecuador" 52 | - "south-america/peru" 53 | 54 | 55 | 56 | ### Get the party started 57 | 58 | From the command line, just run `vagrant up` and give it a few minutes to do it 59 | does its thing. When it finishes running, a PostGIS database will be ready to go 60 | and loaded up with OSM data! 61 | 62 | 63 | ### Everything is OSM 64 | 65 | The PostGIS database will be available on localhost. For example, to connect to 66 | the database from Tilemill: 67 | 68 | dbname=osm host=localhost port=5432 user=osm password=osm 69 | 70 | 71 | ![Tilemill Screenshot](doc/tilemill-screenshot.png) 72 | 73 | 74 | Or from QGIS: 75 | 76 | ![QGIS Screenshot](doc/qgis-screenshot.png) 77 | 78 | 79 | ## Additional Usage 80 | 81 | 82 | ### Customizing 83 | 84 | The file `variables.yml` contains the database name, user and password (all 85 | default to "osm"), as well as port number (default 5432), and settings for 86 | virtual machine memory and number of cpus. Feel free to open up `variables.yml` 87 | and change any of these values. You will need to [reload](#advanced-vagrant) the 88 | virtual machine for settings to take effect. 89 | 90 | 91 | ### Vagrant Basics 92 | 93 | This project uses [vagrant](http://vagrantup.com/) to manage the virtual 94 | machine. Vagrant provides a pretty simple interface. These are the most relevant 95 | commands: 96 | 97 | `vagrant up` starts up the virtual machine and runs through the configuration 98 | and import scripts. 99 | 100 | `vagrant halt` stops the virtual machine. This releases any RAM you've dedicated 101 | to the virtual machine. After this, the PostGIS database will not be available 102 | until `vagrant up` is run again. 103 | 104 | 105 | ### Advanced Vagrant 106 | 107 | `vagrant reload` restarts the virtual machine. It is equivalent to `vagrant 108 | halt` then `vagrant up`. 109 | 110 | `vagrant up --no-provision` will skip the import phase. This will save time if 111 | data extracts have previously been imported and the virtual machine was stopped 112 | with `vagrant halt`. 113 | 114 | `vagrant destroy` will completely wipe out the virtual machine. All the files 115 | and data on the virtual machine will be removed, including anything in the 116 | database. It is useful if you want to reclaim disk space or just start over 117 | from scratch. 118 | 119 | `vagrant provision` will just run through the setup and import phase without 120 | stopping the virtual machine. This can be slightly faster than a `vagrant 121 | reload` if new extracts have been added to `variables.yml` and those need to 122 | be imported. 123 | 124 | `vagrant ssh` can be used to login to the virtual machine via secure shell. 125 | This can be useful if something went wrong or you just want to poke around. 126 | 127 | 128 | ### Super Advanced Additional Usage 129 | 130 | The virtual machine underneath all of this is an instance of the 131 | [Ubuntu 14.04](http://releases.ubuntu.com/14.04/) distribution. 132 | The majority of the work is done with [Ansible](http://docs.ansible.com/), 133 | an open source configuration management system. With only a little bit of 134 | fiddling, the scripts can be ported to work with another operating system 135 | or run on a remote server. Please feel free to remix, reuse and enjoy! 136 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | require 'yaml' 4 | 5 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 6 | VAGRANTFILE_API_VERSION = "2" 7 | 8 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 9 | # All Vagrant configuration is done here. The most common configuration 10 | # options are documented and commented below. For a complete reference, 11 | # please see the online documentation at vagrantup.com. 12 | 13 | variables = YAML.load_file('variables.yml') 14 | internals = YAML.load_file('ansible/_internals.yml') 15 | 16 | if ['foo'].pack('p').size == 8 17 | bits = "64" 18 | else 19 | bits = "32" 20 | end 21 | 22 | # Every Vagrant virtual environment requires a box to build off of. 23 | config.vm.box = "ubuntu/trusty" + bits 24 | 25 | # The url from where the 'config.vm.box' box will be fetched if it 26 | # doesn't already exist on the user's system. 27 | # config.vm.box_url = "http://domain.com/path/to/above.box" 28 | 29 | # Create a forwarded port mapping which allows access to a specific port 30 | # within the machine from a port on the host machine. In the example below, 31 | # accessing "localhost:8080" will access port 80 on the guest machine. 32 | # config.vm.network :forwarded_port, guest: 80, host: 8080 33 | 34 | db_port = variables.fetch('db_port', 5432) 35 | config.vm.network :forwarded_port, guest: 5432, host: db_port 36 | 37 | # Create a private network, which allows host-only access to the machine 38 | # using a specific IP. 39 | # config.vm.network :private_network, ip: "192.168.33.10" 40 | 41 | # Create a public network, which generally matched to bridged network. 42 | # Bridged networks make the machine appear as another physical device on 43 | # your network. 44 | # config.vm.network :public_network 45 | 46 | # If true, then any SSH connections made will enable agent forwarding. 47 | # Default value: false 48 | # config.ssh.forward_agent = true 49 | 50 | # Share an additional folder to the guest VM. The first argument is 51 | # the path on the host to the actual folder. The second argument is 52 | # the path on the guest to mount the folder. And the optional third 53 | # argument is a set of non-required options. 54 | # config.vm.synced_folder "../data", "/vagrant_data" 55 | 56 | # Provider-specific configuration so you can fine-tune various 57 | # backing providers for Vagrant. These expose provider-specific options. 58 | # Example for VirtualBox: 59 | # 60 | # config.vm.provider :virtualbox do |vb| 61 | # # Don't boot with headless mode 62 | # vb.gui = true 63 | # 64 | # # Use VBoxManage to customize the VM. For example to change memory: 65 | # vb.customize ["modifyvm", :id, "--memory", "1024"] 66 | # end 67 | 68 | extra_storage = variables.fetch('extra_storage', false) 69 | 70 | config.vm.provider :virtualbox do |vb| 71 | memory = variables.fetch('vm_ram', false) 72 | if memory 73 | vb.memory = memory 74 | end 75 | 76 | cpus = variables.fetch('vm_cpus', false) 77 | if cpus 78 | vb.cpus = cpus 79 | end 80 | 81 | if extra_storage 82 | file_to_disk = variables.fetch('extra_storage_file', './tmp/vm-extra-storage.vdi') 83 | 84 | unless File.exist?(file_to_disk) 85 | vb.customize ['createhd', '--filename', file_to_disk, '--size', variables.fetch('extra_storage_gb') * 1024] 86 | end 87 | 88 | vb.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] 89 | end 90 | end 91 | 92 | 93 | # View the documentation for the provider you're using for more 94 | # information on available options. 95 | 96 | config.vm.provision "shell", path: "init/bootstrap_ansible.sh", args: [extra_storage ? "1" : "0", internals.fetch('osm_dir')], run: "always" 97 | 98 | # Enable provisioning with Puppet stand alone. Puppet manifests 99 | # are contained in a directory path relative to this Vagrantfile. 100 | # You will need to create the manifests directory and a manifest in 101 | # the file ubuntu/trusty64.pp in the manifests_path directory. 102 | # 103 | # An example Puppet manifest to provision the message of the day: 104 | # 105 | # # group { "puppet": 106 | # # ensure => "present", 107 | # # } 108 | # # 109 | # # File { owner => 0, group => 0, mode => 0644 } 110 | # # 111 | # # file { '/etc/motd': 112 | # # content => "Welcome to your Vagrant-built virtual machine! 113 | # # Managed by Puppet.\n" 114 | # # } 115 | # 116 | # config.vm.provision :puppet do |puppet| 117 | # puppet.manifests_path = "manifests" 118 | # puppet.manifest_file = "site.pp" 119 | # end 120 | 121 | # Enable provisioning with chef solo, specifying a cookbooks path, roles 122 | # path, and data_bags path (all relative to this Vagrantfile), and adding 123 | # some recipes and/or roles. 124 | # 125 | # config.vm.provision :chef_solo do |chef| 126 | # chef.cookbooks_path = "../my-recipes/cookbooks" 127 | # chef.roles_path = "../my-recipes/roles" 128 | # chef.data_bags_path = "../my-recipes/data_bags" 129 | # chef.add_recipe "mysql" 130 | # chef.add_role "web" 131 | # 132 | # # You may also specify custom JSON attributes: 133 | # chef.json = { :mysql_password => "foo" } 134 | # end 135 | 136 | # Enable provisioning with chef server, specifying the chef server URL, 137 | # and the path to the validation key (relative to this Vagrantfile). 138 | # 139 | # The Opscode Platform uses HTTPS. Substitute your organization for 140 | # ORGNAME in the URL and validation key. 141 | # 142 | # If you have your own Chef Server, use the appropriate URL, which may be 143 | # HTTP instead of HTTPS depending on your configuration. Also change the 144 | # validation key to validation.pem. 145 | # 146 | # config.vm.provision :chef_client do |chef| 147 | # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" 148 | # chef.validation_key_path = "ORGNAME-validator.pem" 149 | # end 150 | # 151 | # If you're using the Opscode platform, your validator client is 152 | # ORGNAME-validator, replacing ORGNAME with your organization name. 153 | # 154 | # If you have your own Chef Server, the default validation client name is 155 | # chef-validator, unless you changed the configuration. 156 | # 157 | # chef.validation_client_name = "ORGNAME-validator" 158 | end 159 | -------------------------------------------------------------------------------- /ansible/_internals.yml: -------------------------------------------------------------------------------- 1 | --- 2 | setup: true 3 | import: true 4 | 5 | osm_dir: /var/osm 6 | extra_storage_tablespace: "extra_storage" 7 | extra_storage_tablespace_dir: "{{osm_dir}}/postgresql-tablespace" 8 | imposm3_build_dir: "{{osm_dir}}/imposm3" 9 | imposm3_bin: "{{imposm3_build_dir}}/imposm3" 10 | imposm3_cache_dir: "{{osm_dir}}/cache" 11 | imposm3_packages: 12 | - golang 13 | - git 14 | - libgeos++-dev 15 | - libleveldb-dev 16 | - libprotobuf-dev 17 | - libsqlite3-dev 18 | - mercurial 19 | imposm3_version: 3b73f91a0d144524b6b9bac7011ffc9e90276e58 20 | postgis_packages: 21 | - postgresql-9.3 22 | - postgresql-9.3-postgis-2.1 23 | - python-psycopg2 24 | 25 | geofabrik_tmp_dir: "{{osm_dir}}/geofabrik" 26 | metro_tmp_dir: "{{osm_dir}}/metro" 27 | mapping_json: "{{osm_dir}}/mapping.json" 28 | -------------------------------------------------------------------------------- /ansible/build-imposm.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install imposm3 packages 3 | apt: pkg={{item}} 4 | with_items: imposm3_packages 5 | 6 | - name: make build dir 7 | file: name={{imposm3_build_dir}} state=directory 8 | 9 | - name: git pull imposm3 repo 10 | git: repo=git://github.com/omniscale/imposm3.git dest={{imposm3_build_dir}}/src/imposm3 version={{imposm3_version}} accept_hostkey=yes 11 | 12 | - name: go get imposm3 13 | command: go get imposm3 chdir={{imposm3_build_dir}} 14 | environment: 15 | GOPATH: "{{imposm3_build_dir}}" 16 | 17 | - name: go build imposm3 18 | command: go build -o "{{imposm3_bin}}" imposm3 chdir={{imposm3_build_dir}} 19 | environment: 20 | GOPATH: "{{imposm3_build_dir}}" 21 | -------------------------------------------------------------------------------- /ansible/everything-is-osm.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | sudo: yes 4 | 5 | vars_files: 6 | - ../variables.yml 7 | - _internals.yml 8 | 9 | handlers: 10 | - name: restart postgresql 11 | service: name=postgresql state=restarted 12 | 13 | tasks: 14 | - name: update apt cache 15 | apt: update_cache=yes cache_valid_time=604800 16 | when: setup 17 | 18 | - name: check if imposm3 has already been built 19 | stat: path={{imposm3_bin}} 20 | register: imposm3 21 | 22 | - include: build-imposm.yml 23 | when: setup and not imposm3.stat.exists 24 | 25 | - include: setup-database.yml 26 | when: setup 27 | 28 | - include: import-data.yml 29 | when: import 30 | -------------------------------------------------------------------------------- /ansible/import-data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: make metro extract dir 3 | file: path={{metro_tmp_dir}} recurse=yes state=directory 4 | when: metro_extracts 5 | sudo: no 6 | 7 | - name: download metro extracts 8 | get_url: url=http://s3.amazonaws.com/metro-extracts.mapzen.com/{{item}}.osm.pbf dest={{metro_tmp_dir}}/{{item}}.osm.pbf 9 | with_items: metro_extracts 10 | when: metro_extracts 11 | sudo: no 12 | 13 | - name: make geofabrik extract dirs 14 | file: path={{geofabrik_tmp_dir}}/{{item | dirname}} recurse=yes state=directory 15 | with_items: geofabrik_extracts 16 | when: geofabrik_extracts 17 | sudo: no 18 | 19 | - name: download geofabrik extracts 20 | get_url: url=http://download.geofabrik.de/{{item}}-latest.osm.pbf dest={{geofabrik_tmp_dir}}/{{item}}.osm.pbf 21 | with_items: geofabrik_extracts 22 | when: geofabrik_extracts 23 | sudo: no 24 | 25 | - name: write mapping.json file 26 | template: src=templates/mapping.json dest={{mapping_json}} 27 | 28 | - name: add metro extracts to imposm3 cache 29 | command: "{{imposm3_bin}} import -connection postgis://osm:osm@localhost/osm -mapping {{mapping_json}} -read {{metro_tmp_dir}}/{{item}}.osm.pbf -appendcache -cachedir={{imposm3_cache_dir}}" 30 | with_items: metro_extracts 31 | when: metro_extracts 32 | 33 | - name: add geofabrik extracts to imposm3 cache 34 | command: "{{imposm3_bin}} import -connection postgis://osm:osm@localhost/osm -mapping {{mapping_json}} -read {{geofabrik_tmp_dir}}/{{item}}.osm.pbf -appendcache -cachedir={{imposm3_cache_dir}}" 35 | with_items: geofabrik_extracts 36 | when: geofabrik_extracts 37 | 38 | - name: write OSM data to PostGIS 39 | command: "{{imposm3_bin}} import -connection postgis://osm:osm@localhost/osm -mapping {{mapping_json}} -write -cachedir={{imposm3_cache_dir}} -dbschema-import={{db_schema}}" 40 | 41 | -------------------------------------------------------------------------------- /ansible/setup-database.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install postgis packages 3 | apt: pkg={{item}} 4 | with_items: postgis_packages 5 | 6 | - name: write postgres.conf file 7 | template: src=templates/postgresql.conf.j2 dest=/etc/postgresql/9.3/main/postgresql.conf 8 | notify: restart postgresql 9 | 10 | - name: write pg_hba.conf file 11 | template: src=templates/pg_hba.conf.j2 dest=/etc/postgresql/9.3/main/pg_hba.conf 12 | notify: restart postgresql 13 | 14 | - name: create .pgpass file 15 | template: src=templates/pgpass.j2 dest=~/.pgpass mode=0600 16 | sudo: no 17 | 18 | - name: make sure postgres has started 19 | service: name=postgresql state=started 20 | 21 | - name: make osm dir 22 | file: path={{osm_dir}} recurse=yes state=directory owner={{ansible_ssh_user}} 23 | 24 | - name: create db user 25 | sudo_user: postgres 26 | postgresql_user: name={{db_user}} 27 | password={{db_password}} 28 | encrypted=false 29 | 30 | - name: make tablespace dir 31 | file: path={{extra_storage_tablespace_dir}} recurse=yes state=directory owner=postgres group=postgres 32 | when: extra_storage 33 | 34 | - name: check if tablespace exists 35 | sudo_user: postgres 36 | command: psql -c "select spcname from pg_tablespace where spcname ='{{extra_storage_tablespace}}';" 37 | register: tablespace 38 | when: extra_storage 39 | 40 | - name: create tablespace 41 | sudo_user: postgres 42 | command: psql -c "CREATE TABLESPACE {{extra_storage_tablespace}} OWNER {{db_user}} LOCATION '{{extra_storage_tablespace_dir}}';" 43 | when: extra_storage and tablespace.stdout.find('0 rows') != -1 44 | 45 | - name: check if database exists 46 | sudo_user: postgres 47 | command: psql -c "select 1 from pg_database where datname ='{{db_name}}';" 48 | register: database_exists 49 | when: extra_storage 50 | 51 | - name: create osm database with tablespace 52 | sudo_user: postgres 53 | command: psql -c "CREATE database {{db_name}} OWNER {{db_user}} TABLESPACE {{extra_storage_tablespace}}" 54 | when: extra_storage and database_exists.stdout.find('0 rows') != -1 55 | 56 | - name: create osm database without tablespace 57 | sudo_user: postgres 58 | postgresql_db: name={{db_name}} owner={{db_user}} 59 | when: not extra_storage 60 | 61 | - name: enable postgis on osm database 62 | sudo_user: postgres 63 | command: psql -d {{db_name}} -c 'CREATE EXTENSION IF NOT EXISTS postgis;' 64 | 65 | - name: enable hstore on osm database 66 | sudo_user: postgres 67 | command: psql -d {{db_name}} -c 'CREATE EXTENSION IF NOT EXISTS hstore;' 68 | -------------------------------------------------------------------------------- /ansible/templates/mapping.json: -------------------------------------------------------------------------------- 1 | { 2 | "generalized_tables": { 3 | "waterareas_gen1": { 4 | "source": "waterareas", 5 | "sql_filter": "ST_Area(geometry)>50000.000000", 6 | "tolerance": 50.0 7 | }, 8 | "waterareas_gen0": { 9 | "source": "waterareas_gen1", 10 | "sql_filter": "ST_Area(geometry)>500000.000000", 11 | "tolerance": 200.0 12 | }, 13 | "roads_gen0": { 14 | "source": "roads_gen1", 15 | "sql_filter": null, 16 | "tolerance": 200.0 17 | }, 18 | "roads_gen1": { 19 | "source": "roads", 20 | "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link') OR class IN('railway')", 21 | "tolerance": 50.0 22 | }, 23 | "waterways_gen0": { 24 | "source": "waterways_gen1", 25 | "sql_filter": null, 26 | "tolerance": 200 27 | }, 28 | "waterways_gen1": { 29 | "source": "waterways", 30 | "sql_filter": null, 31 | "tolerance": 50.0 32 | }, 33 | "landusages_gen1": { 34 | "source": "landusages", 35 | "sql_filter": "ST_Area(geometry)>50000.000000", 36 | "tolerance": 50.0 37 | }, 38 | "landusages_gen0": { 39 | "source": "landusages_gen1", 40 | "sql_filter": "ST_Area(geometry)>500000.000000", 41 | "tolerance": 200.0 42 | } 43 | }, 44 | "tables": { 45 | "landusages": { 46 | "fields": [ 47 | { 48 | "type": "id", 49 | "name": "osm_id", 50 | "key": null 51 | }, 52 | { 53 | "type": "geometry", 54 | "name": "geometry", 55 | "key": null 56 | }, 57 | { 58 | "type": "string", 59 | "name": "name", 60 | "key": "name" 61 | }, 62 | { 63 | "type": "mapping_value", 64 | "name": "type", 65 | "key": null 66 | }, 67 | { 68 | "type": "pseudoarea", 69 | "name": "area", 70 | "key": null 71 | }, 72 | { 73 | "args": { 74 | "ranks": [ 75 | "pedestrian", 76 | "footway", 77 | "playground", 78 | "park", 79 | "forest", 80 | "cemetery", 81 | "farmyard", 82 | "farm", 83 | "farmland", 84 | "wood", 85 | "meadow", 86 | "grass", 87 | "wetland", 88 | "village_green", 89 | "recreation_ground", 90 | "garden", 91 | "sports_centre", 92 | "pitch", 93 | "common", 94 | "allotments", 95 | "golf_course", 96 | "university", 97 | "school", 98 | "college", 99 | "library", 100 | "baracks", 101 | "fuel", 102 | "parking", 103 | "nature_reserve", 104 | "cinema", 105 | "theatre", 106 | "place_of_worship", 107 | "hospital", 108 | "scrub", 109 | "orchard", 110 | "vineyard", 111 | "zoo", 112 | "quarry", 113 | "residential", 114 | "retail", 115 | "commercial", 116 | "industrial", 117 | "railway", 118 | "heath", 119 | "island", 120 | "land" 121 | ] 122 | }, 123 | "type": "zorder", 124 | "name": "z_order", 125 | "key": "z_order" 126 | } 127 | ], 128 | "type": "polygon", 129 | "mapping": { 130 | "amenity": [ 131 | "university", 132 | "school", 133 | "college", 134 | "library", 135 | "fuel", 136 | "parking", 137 | "cinema", 138 | "theatre", 139 | "place_of_worship", 140 | "hospital" 141 | ], 142 | "barrier": [ 143 | "hedge" 144 | ], 145 | "leisure": [ 146 | "park", 147 | "garden", 148 | "playground", 149 | "golf_course", 150 | "sports_centre", 151 | "pitch", 152 | "stadium", 153 | "common", 154 | "nature_reserve" 155 | ], 156 | "tourism": [ 157 | "zoo" 158 | ], 159 | "natural": [ 160 | "wood", 161 | "land", 162 | "scrub", 163 | "wetland", 164 | "heath" 165 | ], 166 | "man_made": [ 167 | "pier" 168 | ], 169 | "aeroway": [ 170 | "runway", 171 | "taxiway" 172 | ], 173 | "place": [ 174 | "island" 175 | ], 176 | "military": [ 177 | "barracks" 178 | ], 179 | "landuse": [ 180 | "park", 181 | "forest", 182 | "residential", 183 | "retail", 184 | "commercial", 185 | "industrial", 186 | "railway", 187 | "cemetery", 188 | "grass", 189 | "farmyard", 190 | "farm", 191 | "farmland", 192 | "orchard", 193 | "vineyard", 194 | "wood", 195 | "meadow", 196 | "village_green", 197 | "recreation_ground", 198 | "allotments", 199 | "quarry" 200 | ], 201 | "highway": [ 202 | "pedestrian", 203 | "footway" 204 | ] 205 | } 206 | }, 207 | "buildings": { 208 | "fields": [ 209 | { 210 | "type": "id", 211 | "name": "osm_id", 212 | "key": null 213 | }, 214 | { 215 | "type": "geometry", 216 | "name": "geometry", 217 | "key": null 218 | }, 219 | { 220 | "type": "string", 221 | "name": "name", 222 | "key": "name" 223 | }, 224 | { 225 | "type": "pseudoarea", 226 | "name": "area", 227 | "key": "area" 228 | }, 229 | { 230 | "type": "mapping_value", 231 | "name": "type", 232 | "key": null 233 | } 234 | ], 235 | "type": "polygon", 236 | "mapping": { 237 | "building": [ 238 | "__any__" 239 | ] 240 | } 241 | }, 242 | "places": { 243 | "fields": [ 244 | { 245 | "type": "id", 246 | "name": "osm_id", 247 | "key": null 248 | }, 249 | { 250 | "type": "geometry", 251 | "name": "geometry", 252 | "key": null 253 | }, 254 | { 255 | "type": "string", 256 | "name": "name", 257 | "key": "name" 258 | }, 259 | { 260 | "type": "mapping_value", 261 | "name": "type", 262 | "key": null 263 | }, 264 | { 265 | "args": { 266 | "ranks": [ 267 | "country", 268 | "state", 269 | "region", 270 | "county", 271 | "city", 272 | "town", 273 | "village", 274 | "hamlet", 275 | "suburb", 276 | "locality" 277 | ] 278 | }, 279 | "type": "zorder", 280 | "name": "z_order", 281 | "key": "z_order" 282 | }, 283 | { 284 | "type": "integer", 285 | "name": "population", 286 | "key": "population" 287 | } 288 | ], 289 | "type": "point", 290 | "mapping": { 291 | "place": [ 292 | "country", 293 | "state", 294 | "region", 295 | "county", 296 | "city", 297 | "town", 298 | "village", 299 | "hamlet", 300 | "suburb", 301 | "locality" 302 | ] 303 | } 304 | }, 305 | "transport_areas": { 306 | "fields": [ 307 | { 308 | "type": "id", 309 | "name": "osm_id", 310 | "key": null 311 | }, 312 | { 313 | "type": "geometry", 314 | "name": "geometry", 315 | "key": null 316 | }, 317 | { 318 | "type": "string", 319 | "name": "name", 320 | "key": "name" 321 | }, 322 | { 323 | "type": "mapping_value", 324 | "name": "type", 325 | "key": null 326 | } 327 | ], 328 | "type": "polygon", 329 | "mapping": { 330 | "railway": [ 331 | "station", 332 | "platform" 333 | ], 334 | "aeroway": [ 335 | "aerodrome", 336 | "terminal", 337 | "helipad", 338 | "apron" 339 | ] 340 | } 341 | }, 342 | "admin": { 343 | "fields": [ 344 | { 345 | "type": "id", 346 | "name": "osm_id", 347 | "key": null 348 | }, 349 | { 350 | "type": "geometry", 351 | "name": "geometry", 352 | "key": null 353 | }, 354 | { 355 | "type": "string", 356 | "name": "name", 357 | "key": "name" 358 | }, 359 | { 360 | "type": "mapping_value", 361 | "name": "type", 362 | "key": null 363 | }, 364 | { 365 | "type": "integer", 366 | "name": "admin_level", 367 | "key": "admin_level" 368 | } 369 | ], 370 | "type": "polygon", 371 | "mapping": { 372 | "boundary": [ 373 | "administrative" 374 | ] 375 | } 376 | }, 377 | "aeroways": { 378 | "fields": [ 379 | { 380 | "type": "id", 381 | "name": "osm_id", 382 | "key": null 383 | }, 384 | { 385 | "type": "geometry", 386 | "name": "geometry", 387 | "key": null 388 | }, 389 | { 390 | "type": "string", 391 | "name": "name", 392 | "key": "name" 393 | }, 394 | { 395 | "type": "mapping_value", 396 | "name": "type", 397 | "key": null 398 | } 399 | ], 400 | "type": "linestring", 401 | "mapping": { 402 | "aeroway": [ 403 | "runway", 404 | "taxiway" 405 | ] 406 | } 407 | }, 408 | "waterways": { 409 | "fields": [ 410 | { 411 | "type": "id", 412 | "name": "osm_id", 413 | "key": null 414 | }, 415 | { 416 | "type": "geometry", 417 | "name": "geometry", 418 | "key": null 419 | }, 420 | { 421 | "type": "string", 422 | "name": "name", 423 | "key": "name" 424 | }, 425 | { 426 | "type": "mapping_value", 427 | "name": "type", 428 | "key": null 429 | } 430 | ], 431 | "type": "linestring", 432 | "mapping": { 433 | "waterway": [ 434 | "stream", 435 | "river", 436 | "canal", 437 | "drain", 438 | "ditch" 439 | ], 440 | "barrier": [ 441 | "ditch" 442 | ] 443 | } 444 | }, 445 | "barrierways": { 446 | "fields": [ 447 | { 448 | "type": "id", 449 | "name": "osm_id", 450 | "key": null 451 | }, 452 | { 453 | "type": "geometry", 454 | "name": "geometry", 455 | "key": null 456 | }, 457 | { 458 | "type": "string", 459 | "name": "name", 460 | "key": "name" 461 | }, 462 | { 463 | "type": "mapping_value", 464 | "name": "type", 465 | "key": null 466 | } 467 | ], 468 | "type": "linestring", 469 | "mapping": { 470 | "barrier": [ 471 | "city_wall", 472 | "fence", 473 | "hedge", 474 | "retaining_wall", 475 | "wall", 476 | "bollard", 477 | "gate", 478 | "spikes", 479 | "lift_gate", 480 | "kissing_gate", 481 | "embankment", 482 | "yes", 483 | "wire_fence" 484 | ] 485 | } 486 | }, 487 | "transport_points": { 488 | "fields": [ 489 | { 490 | "type": "id", 491 | "name": "osm_id", 492 | "key": null 493 | }, 494 | { 495 | "type": "geometry", 496 | "name": "geometry", 497 | "key": null 498 | }, 499 | { 500 | "type": "string", 501 | "name": "name", 502 | "key": "name" 503 | }, 504 | { 505 | "type": "mapping_value", 506 | "name": "type", 507 | "key": null 508 | }, 509 | { 510 | "type": "string", 511 | "name": "ref", 512 | "key": "ref" 513 | } 514 | ], 515 | "type": "point", 516 | "mapping": { 517 | "railway": [ 518 | "station", 519 | "halt", 520 | "tram_stop", 521 | "crossing", 522 | "level_crossing", 523 | "subway_entrance" 524 | ], 525 | "aeroway": [ 526 | "aerodrome", 527 | "terminal", 528 | "helipad", 529 | "gate" 530 | ], 531 | "highway": [ 532 | "motorway_junction", 533 | "turning_circle", 534 | "bus_stop" 535 | ] 536 | } 537 | }, 538 | "amenities": { 539 | "fields": [ 540 | { 541 | "type": "id", 542 | "name": "osm_id", 543 | "key": null 544 | }, 545 | { 546 | "type": "geometry", 547 | "name": "geometry", 548 | "key": null 549 | }, 550 | { 551 | "type": "string", 552 | "name": "name", 553 | "key": "name" 554 | }, 555 | { 556 | "type": "mapping_value", 557 | "name": "type", 558 | "key": null 559 | } 560 | ], 561 | "type": "point", 562 | "mapping": { 563 | "amenity": [ 564 | "university", 565 | "school", 566 | "library", 567 | "fuel", 568 | "hospital", 569 | "fire_station", 570 | "police", 571 | "townhall" 572 | ] 573 | } 574 | }, 575 | "barrierpoints": { 576 | "fields": [ 577 | { 578 | "type": "id", 579 | "name": "osm_id", 580 | "key": null 581 | }, 582 | { 583 | "type": "geometry", 584 | "name": "geometry", 585 | "key": null 586 | }, 587 | { 588 | "type": "string", 589 | "name": "name", 590 | "key": "name" 591 | }, 592 | { 593 | "type": "mapping_value", 594 | "name": "type", 595 | "key": null 596 | } 597 | ], 598 | "type": "point", 599 | "mapping": { 600 | "barrier": [ 601 | "block", 602 | "bollard", 603 | "cattle_grid", 604 | "chain", 605 | "cycle_barrier", 606 | "entrance", 607 | "horse_stile", 608 | "gate", 609 | "spikes", 610 | "lift_gate", 611 | "kissing_gate", 612 | "fence", 613 | "yes", 614 | "wire_fence", 615 | "toll_booth", 616 | "stile" 617 | ] 618 | } 619 | }, 620 | "housenumbers_interpolated": { 621 | "fields": [ 622 | { 623 | "type": "id", 624 | "name": "osm_id", 625 | "key": null 626 | }, 627 | { 628 | "type": "geometry", 629 | "name": "geometry", 630 | "key": null 631 | }, 632 | { 633 | "type": "string", 634 | "name": "name", 635 | "key": "name" 636 | }, 637 | { 638 | "type": "mapping_value", 639 | "name": "type", 640 | "key": null 641 | }, 642 | { 643 | "type": "string", 644 | "name": "addr:street", 645 | "key": "addr:street" 646 | }, 647 | { 648 | "type": "string", 649 | "name": "addr:postcode", 650 | "key": "addr:postcode" 651 | }, 652 | { 653 | "type": "string", 654 | "name": "addr:city", 655 | "key": "addr:city" 656 | }, 657 | { 658 | "type": "string", 659 | "name": "addr:inclusion", 660 | "key": "addr:inclusion" 661 | } 662 | ], 663 | "type": "linestring", 664 | "mapping": { 665 | "addr:interpolation": [ 666 | "__any__" 667 | ] 668 | } 669 | }, 670 | "roads": { 671 | "fields": [ 672 | { 673 | "type": "id", 674 | "name": "osm_id", 675 | "key": null 676 | }, 677 | { 678 | "type": "geometry", 679 | "name": "geometry", 680 | "key": null 681 | }, 682 | { 683 | "type": "mapping_value", 684 | "name": "type", 685 | "key": null 686 | }, 687 | { 688 | "type": "string", 689 | "name": "name", 690 | "key": "name" 691 | }, 692 | { 693 | "type": "boolint", 694 | "name": "tunnel", 695 | "key": "tunnel" 696 | }, 697 | { 698 | "type": "boolint", 699 | "name": "bridge", 700 | "key": "bridge" 701 | }, 702 | { 703 | "type": "direction", 704 | "name": "oneway", 705 | "key": "oneway" 706 | }, 707 | { 708 | "type": "string", 709 | "name": "ref", 710 | "key": "ref" 711 | }, 712 | { 713 | "type": "integer", 714 | "name": "layer", 715 | "key": "layer" 716 | }, 717 | { 718 | "type": "wayzorder", 719 | "name": "z_order", 720 | "key": "z_order" 721 | }, 722 | { 723 | "type": "string", 724 | "name": "access", 725 | "key": "access" 726 | }, 727 | { 728 | "type": "string", 729 | "name": "service", 730 | "key": "service" 731 | }, 732 | { 733 | "type": "mapping_key", 734 | "name": "class", 735 | "key": null 736 | } 737 | ], 738 | "type": "linestring", 739 | "filters": { 740 | "exclude_tags": [ 741 | ["area", "yes"] 742 | ] 743 | }, 744 | "mappings": { 745 | "railway": { 746 | "mapping": { 747 | "railway": [ 748 | "rail", 749 | "tram", 750 | "light_rail", 751 | "subway", 752 | "narrow_gauge", 753 | "preserved", 754 | "funicular", 755 | "monorail", 756 | "disused" 757 | ] 758 | } 759 | }, 760 | "roads": { 761 | "mapping": { 762 | "man_made": [ 763 | "pier", 764 | "groyne" 765 | ], 766 | "highway": [ 767 | "motorway", 768 | "motorway_link", 769 | "trunk", 770 | "trunk_link", 771 | "primary", 772 | "primary_link", 773 | "secondary", 774 | "secondary_link", 775 | "tertiary", 776 | "tertiary_link", 777 | "road", 778 | "path", 779 | "track", 780 | "service", 781 | "footway", 782 | "bridleway", 783 | "cycleway", 784 | "steps", 785 | "pedestrian", 786 | "living_street", 787 | "unclassified", 788 | "residential", 789 | "raceway" 790 | ] 791 | } 792 | } 793 | } 794 | }, 795 | "motorways": { 796 | "fields": [ 797 | { 798 | "type": "id", 799 | "name": "osm_id", 800 | "key": null 801 | }, 802 | { 803 | "type": "geometry", 804 | "name": "geometry", 805 | "key": null 806 | }, 807 | { 808 | "type": "mapping_value", 809 | "name": "type", 810 | "key": null 811 | }, 812 | { 813 | "type": "string", 814 | "name": "name", 815 | "key": "name" 816 | }, 817 | { 818 | "type": "direction", 819 | "name": "oneway", 820 | "key": "oneway" 821 | }, 822 | { 823 | "type": "string", 824 | "name": "ref", 825 | "key": "ref" 826 | } 827 | ], 828 | "type": "linestring", 829 | "filters": { 830 | "exclude_tags": [ 831 | ["area", "yes"] 832 | ] 833 | }, 834 | "mapping": { 835 | "highway": [ 836 | "motorway", 837 | "motorway_link", 838 | "trunk", 839 | "trunk_link" 840 | ] 841 | } 842 | }, 843 | "mainroads": { 844 | "fields": [ 845 | { 846 | "type": "id", 847 | "name": "osm_id", 848 | "key": null 849 | }, 850 | { 851 | "type": "geometry", 852 | "name": "geometry", 853 | "key": null 854 | }, 855 | { 856 | "type": "mapping_value", 857 | "name": "type", 858 | "key": null 859 | }, 860 | { 861 | "type": "string", 862 | "name": "name", 863 | "key": "name" 864 | }, 865 | { 866 | "type": "direction", 867 | "name": "oneway", 868 | "key": "oneway" 869 | } 870 | ], 871 | "type": "linestring", 872 | "filters": { 873 | "exclude_tags": [ 874 | ["area", "yes"] 875 | ] 876 | }, 877 | "mapping": { 878 | "highway": [ 879 | "primary", 880 | "primary_link", 881 | "secondary", 882 | "secondary_link", 883 | "tertiary", 884 | "tertiary_link" 885 | ] 886 | } 887 | }, 888 | "minorroads": { 889 | "fields": [ 890 | { 891 | "type": "id", 892 | "name": "osm_id", 893 | "key": null 894 | }, 895 | { 896 | "type": "geometry", 897 | "name": "geometry", 898 | "key": null 899 | }, 900 | { 901 | "type": "mapping_value", 902 | "name": "type", 903 | "key": null 904 | }, 905 | { 906 | "type": "string", 907 | "name": "name", 908 | "key": "name" 909 | }, 910 | { 911 | "type": "direction", 912 | "name": "oneway", 913 | "key": "oneway" 914 | } 915 | ], 916 | "type": "linestring", 917 | "filters": { 918 | "exclude_tags": [ 919 | ["area", "yes"] 920 | ] 921 | }, 922 | "mapping": { 923 | "highway": [ 924 | "road", 925 | "path", 926 | "track", 927 | "service", 928 | "footway", 929 | "bridleway", 930 | "cycleway", 931 | "steps", 932 | "pedestrian", 933 | "living_street", 934 | "unclassified", 935 | "residential" 936 | ] 937 | } 938 | }, 939 | "housenumbers": { 940 | "fields": [ 941 | { 942 | "type": "id", 943 | "name": "osm_id", 944 | "key": null 945 | }, 946 | { 947 | "type": "geometry", 948 | "name": "geometry", 949 | "key": null 950 | }, 951 | { 952 | "type": "string", 953 | "name": "name", 954 | "key": "name" 955 | }, 956 | { 957 | "type": "mapping_value", 958 | "name": "type", 959 | "key": null 960 | }, 961 | { 962 | "type": "string", 963 | "name": "addr:street", 964 | "key": "addr:street" 965 | }, 966 | { 967 | "type": "string", 968 | "name": "addr:postcode", 969 | "key": "addr:postcode" 970 | }, 971 | { 972 | "type": "string", 973 | "name": "addr:city", 974 | "key": "addr:city" 975 | } 976 | ], 977 | "type": "point", 978 | "mapping": { 979 | "addr:housenumber": [ 980 | "__any__" 981 | ] 982 | } 983 | }, 984 | "waterareas": { 985 | "fields": [ 986 | { 987 | "type": "id", 988 | "name": "osm_id", 989 | "key": null 990 | }, 991 | { 992 | "type": "geometry", 993 | "name": "geometry", 994 | "key": null 995 | }, 996 | { 997 | "type": "string", 998 | "name": "name", 999 | "key": "name" 1000 | }, 1001 | { 1002 | "type": "mapping_value", 1003 | "name": "type", 1004 | "key": null 1005 | }, 1006 | { 1007 | "type": "pseudoarea", 1008 | "name": "area", 1009 | "key": null 1010 | } 1011 | ], 1012 | "type": "polygon", 1013 | "mapping": { 1014 | "waterway": [ 1015 | "riverbank" 1016 | ], 1017 | "landuse": [ 1018 | "basin", 1019 | "reservoir" 1020 | ], 1021 | "natural": [ 1022 | "water" 1023 | ], 1024 | "amenity": [ 1025 | "swimming_pool" 1026 | ], 1027 | "leisure": [ 1028 | "swimming_pool" 1029 | ] 1030 | } 1031 | } 1032 | } 1033 | } 1034 | -------------------------------------------------------------------------------- /ansible/templates/pg_hba.conf.j2: -------------------------------------------------------------------------------- 1 | # PostgreSQL Client Authentication Configuration File 2 | # =================================================== 3 | # 4 | # Refer to the "Client Authentication" section in the PostgreSQL 5 | # documentation for a complete description of this file. A short 6 | # synopsis follows. 7 | # 8 | # This file controls: which hosts are allowed to connect, how clients 9 | # are authenticated, which PostgreSQL user names they can use, which 10 | # databases they can access. Records take one of these forms: 11 | # 12 | # local DATABASE USER METHOD [OPTIONS] 13 | # host DATABASE USER ADDRESS METHOD [OPTIONS] 14 | # hostssl DATABASE USER ADDRESS METHOD [OPTIONS] 15 | # hostnossl DATABASE USER ADDRESS METHOD [OPTIONS] 16 | # 17 | # (The uppercase items must be replaced by actual values.) 18 | # 19 | # The first field is the connection type: "local" is a Unix-domain 20 | # socket, "host" is either a plain or SSL-encrypted TCP/IP socket, 21 | # "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a 22 | # plain TCP/IP socket. 23 | # 24 | # DATABASE can be "all", "sameuser", "samerole", "replication", a 25 | # database name, or a comma-separated list thereof. The "all" 26 | # keyword does not match "replication". Access to replication 27 | # must be enabled in a separate record (see example below). 28 | # 29 | # USER can be "all", a user name, a group name prefixed with "+", or a 30 | # comma-separated list thereof. In both the DATABASE and USER fields 31 | # you can also write a file name prefixed with "@" to include names 32 | # from a separate file. 33 | # 34 | # ADDRESS specifies the set of hosts the record matches. It can be a 35 | # host name, or it is made up of an IP address and a CIDR mask that is 36 | # an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that 37 | # specifies the number of significant bits in the mask. A host name 38 | # that starts with a dot (.) matches a suffix of the actual host name. 39 | # Alternatively, you can write an IP address and netmask in separate 40 | # columns to specify the set of hosts. Instead of a CIDR-address, you 41 | # can write "samehost" to match any of the server's own IP addresses, 42 | # or "samenet" to match any address in any subnet that the server is 43 | # directly connected to. 44 | # 45 | # METHOD can be "trust", "reject", "md5", "password", "gss", "sspi", 46 | # "krb5", "ident", "peer", "pam", "ldap", "radius" or "cert". Note that 47 | # available for which authentication methods. 48 | # 49 | # Database and user names containing spaces, commas, quotes and other 50 | # special characters must be quoted. Quoting one of the keywords 51 | # "all", "sameuser", "samerole" or "replication" makes the name lose 52 | # its special character, and just match a database or username with 53 | # that name. 54 | # 55 | # This file is read on server startup and when the postmaster receives 56 | # a SIGHUP signal. If you edit the file on a running system, you have 57 | # to SIGHUP the postmaster for the changes to take effect. You can 58 | # use "pg_ctl reload" to do that. 59 | 60 | # Put your actual configuration here 61 | # ---------------------------------- 62 | # 63 | # If you want to allow non-local connections, you need to add more 64 | # "host" records. In that case you will also need to make PostgreSQL 65 | # listen on a non-local interface via the listen_addresses 66 | # configuration parameter, or via the -i or -h command line switches. 67 | 68 | 69 | 70 | 71 | # DO NOT DISABLE! 72 | # If you change this first entry you will need to make sure that the 73 | # database superuser can access the database using some other method. 74 | # Noninteractive access to all databases is required during automatic 75 | # maintenance (custom daily cronjobs, replication, and similar tasks). 76 | # 77 | # Database administrative login by Unix domain socket 78 | local all postgres peer 79 | 80 | # TYPE DATABASE USER ADDRESS METHOD 81 | 82 | # "local" is for Unix domain socket connections only 83 | local all all peer 84 | # IPv4 local connections: 85 | host all all 127.0.0.1/32 md5 86 | # IPv6 local connections: 87 | host all all ::1/128 md5 88 | # Allow replication connections from localhost, by a user with the 89 | # replication privilege. 90 | #local replication postgres peer 91 | #host replication postgres 127.0.0.1/32 md5 92 | #host replication postgres ::1/128 md5 93 | 94 | # IPv4 connections from VM host network 95 | host all all 10.0.0.0/16 md5 96 | host all all 192.168.0.0/16 md5 97 | -------------------------------------------------------------------------------- /ansible/templates/pgpass.j2: -------------------------------------------------------------------------------- 1 | localhost:5432:{{ db_name }}:{{ db_user }}:{{ db_password }} 2 | -------------------------------------------------------------------------------- /ansible/templates/postgresql.conf.j2: -------------------------------------------------------------------------------- 1 | # ----------------------------- 2 | # PostgreSQL configuration file 3 | # ----------------------------- 4 | # 5 | # This file consists of lines of the form: 6 | # 7 | # name = value 8 | # 9 | # (The "=" is optional.) Whitespace may be used. Comments are introduced with 10 | # "#" anywhere on a line. The complete list of parameter names and allowed 11 | # values can be found in the PostgreSQL documentation. 12 | # 13 | # The commented-out settings shown in this file represent the default values. 14 | # Re-commenting a setting is NOT sufficient to revert it to the default value; 15 | # you need to reload the server. 16 | # 17 | # This file is read on server startup and when the server receives a SIGHUP 18 | # signal. If you edit the file on a running system, you have to SIGHUP the 19 | # server for the changes to take effect, or use "pg_ctl reload". Some 20 | # parameters, which are marked below, require a server shutdown and restart to 21 | # take effect. 22 | # 23 | # Any parameter can also be given as a command-line option to the server, e.g., 24 | # "postgres -c log_connections=on". Some parameters can be changed at run time 25 | # with the "SET" SQL command. 26 | # 27 | # Memory units: kB = kilobytes Time units: ms = milliseconds 28 | # MB = megabytes s = seconds 29 | # GB = gigabytes min = minutes 30 | # h = hours 31 | # d = days 32 | 33 | 34 | #------------------------------------------------------------------------------ 35 | # FILE LOCATIONS 36 | #------------------------------------------------------------------------------ 37 | 38 | # The default values of these variables are driven from the -D command-line 39 | # option or PGDATA environment variable, represented here as ConfigDir. 40 | 41 | data_directory = '/var/lib/postgresql/9.3/main' # use data in another directory 42 | # (change requires restart) 43 | hba_file = '/etc/postgresql/9.3/main/pg_hba.conf' # host-based authentication file 44 | # (change requires restart) 45 | ident_file = '/etc/postgresql/9.3/main/pg_ident.conf' # ident configuration file 46 | # (change requires restart) 47 | 48 | # If external_pid_file is not explicitly set, no extra PID file is written. 49 | external_pid_file = '/var/run/postgresql/9.3-main.pid' # write an extra PID file 50 | # (change requires restart) 51 | 52 | 53 | #------------------------------------------------------------------------------ 54 | # CONNECTIONS AND AUTHENTICATION 55 | #------------------------------------------------------------------------------ 56 | 57 | # - Connection Settings - 58 | 59 | listen_addresses = '*' # what IP address(es) to listen on; 60 | # comma-separated list of addresses; 61 | # defaults to 'localhost'; use '*' for all 62 | # (change requires restart) 63 | port = 5432 # (change requires restart) 64 | max_connections = 100 # (change requires restart) 65 | # Note: Increasing max_connections costs ~400 bytes of shared memory per 66 | # connection slot, plus lock space (see max_locks_per_transaction). 67 | #superuser_reserved_connections = 3 # (change requires restart) 68 | unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories 69 | # (change requires restart) 70 | #unix_socket_group = '' # (change requires restart) 71 | #unix_socket_permissions = 0777 # begin with 0 to use octal notation 72 | # (change requires restart) 73 | #bonjour = off # advertise server via Bonjour 74 | # (change requires restart) 75 | #bonjour_name = '' # defaults to the computer name 76 | # (change requires restart) 77 | 78 | # - Security and Authentication - 79 | 80 | #authentication_timeout = 1min # 1s-600s 81 | #ssl = true # (change requires restart) 82 | ssl = off # (change requires restart) 83 | #ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers 84 | # (change requires restart) 85 | #ssl_renegotiation_limit = 512MB # amount of data between renegotiations 86 | #ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart) 87 | #ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart) 88 | #ssl_ca_file = '' # (change requires restart) 89 | #ssl_crl_file = '' # (change requires restart) 90 | #password_encryption = on 91 | #db_user_namespace = off 92 | 93 | # Kerberos and GSSAPI 94 | #krb_server_keyfile = '' 95 | #krb_srvname = 'postgres' # (Kerberos only) 96 | #krb_caseins_users = off 97 | 98 | # - TCP Keepalives - 99 | # see "man 7 tcp" for details 100 | 101 | #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; 102 | # 0 selects the system default 103 | #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; 104 | # 0 selects the system default 105 | #tcp_keepalives_count = 0 # TCP_KEEPCNT; 106 | # 0 selects the system default 107 | 108 | 109 | #------------------------------------------------------------------------------ 110 | # RESOURCE USAGE (except WAL) 111 | #------------------------------------------------------------------------------ 112 | 113 | # - Memory - 114 | 115 | shared_buffers = 128MB # min 128kB 116 | # (change requires restart) 117 | #temp_buffers = 8MB # min 800kB 118 | #max_prepared_transactions = 0 # zero disables the feature 119 | # (change requires restart) 120 | # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory 121 | # per transaction slot, plus lock space (see max_locks_per_transaction). 122 | # It is not advisable to set max_prepared_transactions nonzero unless you 123 | # actively intend to use prepared transactions. 124 | #work_mem = 1MB # min 64kB 125 | #maintenance_work_mem = 16MB # min 1MB 126 | #max_stack_depth = 2MB # min 100kB 127 | 128 | # - Disk - 129 | 130 | #temp_file_limit = -1 # limits per-session temp file space 131 | # in kB, or -1 for no limit 132 | 133 | # - Kernel Resource Usage - 134 | 135 | #max_files_per_process = 1000 # min 25 136 | # (change requires restart) 137 | #shared_preload_libraries = '' # (change requires restart) 138 | 139 | # - Cost-Based Vacuum Delay - 140 | 141 | #vacuum_cost_delay = 0 # 0-100 milliseconds 142 | #vacuum_cost_page_hit = 1 # 0-10000 credits 143 | #vacuum_cost_page_miss = 10 # 0-10000 credits 144 | #vacuum_cost_page_dirty = 20 # 0-10000 credits 145 | #vacuum_cost_limit = 200 # 1-10000 credits 146 | 147 | # - Background Writer - 148 | 149 | #bgwriter_delay = 200ms # 10-10000ms between rounds 150 | #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round 151 | #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round 152 | 153 | # - Asynchronous Behavior - 154 | 155 | #effective_io_concurrency = 1 # 1-1000; 0 disables prefetching 156 | 157 | 158 | #------------------------------------------------------------------------------ 159 | # WRITE AHEAD LOG 160 | #------------------------------------------------------------------------------ 161 | 162 | # - Settings - 163 | 164 | #wal_level = minimal # minimal, archive, or hot_standby 165 | # (change requires restart) 166 | #fsync = on # turns forced synchronization on or off 167 | #synchronous_commit = on # synchronization level; 168 | # off, local, remote_write, or on 169 | #wal_sync_method = fsync # the default is the first option 170 | # supported by the operating system: 171 | # open_datasync 172 | # fdatasync (default on Linux) 173 | # fsync 174 | # fsync_writethrough 175 | # open_sync 176 | #full_page_writes = on # recover from partial page writes 177 | #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers 178 | # (change requires restart) 179 | #wal_writer_delay = 200ms # 1-10000 milliseconds 180 | 181 | #commit_delay = 0 # range 0-100000, in microseconds 182 | #commit_siblings = 5 # range 1-1000 183 | 184 | # - Checkpoints - 185 | 186 | #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each 187 | #checkpoint_timeout = 5min # range 30s-1h 188 | #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 189 | #checkpoint_warning = 30s # 0 disables 190 | 191 | # - Archiving - 192 | 193 | #archive_mode = off # allows archiving to be done 194 | # (change requires restart) 195 | #archive_command = '' # command to use to archive a logfile segment 196 | # placeholders: %p = path of file to archive 197 | # %f = file name only 198 | # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' 199 | #archive_timeout = 0 # force a logfile segment switch after this 200 | # number of seconds; 0 disables 201 | 202 | 203 | #------------------------------------------------------------------------------ 204 | # REPLICATION 205 | #------------------------------------------------------------------------------ 206 | 207 | # - Sending Server(s) - 208 | 209 | # Set these on the master and on any standby that will send replication data. 210 | 211 | #max_wal_senders = 0 # max number of walsender processes 212 | # (change requires restart) 213 | #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables 214 | #wal_sender_timeout = 60s # in milliseconds; 0 disables 215 | 216 | # - Master Server - 217 | 218 | # These settings are ignored on a standby server. 219 | 220 | #synchronous_standby_names = '' # standby servers that provide sync rep 221 | # comma-separated list of application_name 222 | # from standby(s); '*' = all 223 | #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed 224 | 225 | # - Standby Servers - 226 | 227 | # These settings are ignored on a master server. 228 | 229 | #hot_standby = off # "on" allows queries during recovery 230 | # (change requires restart) 231 | #max_standby_archive_delay = 30s # max delay before canceling queries 232 | # when reading WAL from archive; 233 | # -1 allows indefinite delay 234 | #max_standby_streaming_delay = 30s # max delay before canceling queries 235 | # when reading streaming WAL; 236 | # -1 allows indefinite delay 237 | #wal_receiver_status_interval = 10s # send replies at least this often 238 | # 0 disables 239 | #hot_standby_feedback = off # send info from standby to prevent 240 | # query conflicts 241 | #wal_receiver_timeout = 60s # time that receiver waits for 242 | # communication from master 243 | # in milliseconds; 0 disables 244 | 245 | 246 | #------------------------------------------------------------------------------ 247 | # QUERY TUNING 248 | #------------------------------------------------------------------------------ 249 | 250 | # - Planner Method Configuration - 251 | 252 | #enable_bitmapscan = on 253 | #enable_hashagg = on 254 | #enable_hashjoin = on 255 | #enable_indexscan = on 256 | #enable_indexonlyscan = on 257 | #enable_material = on 258 | #enable_mergejoin = on 259 | #enable_nestloop = on 260 | #enable_seqscan = on 261 | #enable_sort = on 262 | #enable_tidscan = on 263 | 264 | # - Planner Cost Constants - 265 | 266 | #seq_page_cost = 1.0 # measured on an arbitrary scale 267 | #random_page_cost = 4.0 # same scale as above 268 | #cpu_tuple_cost = 0.01 # same scale as above 269 | #cpu_index_tuple_cost = 0.005 # same scale as above 270 | #cpu_operator_cost = 0.0025 # same scale as above 271 | #effective_cache_size = 128MB 272 | 273 | # - Genetic Query Optimizer - 274 | 275 | #geqo = on 276 | #geqo_threshold = 12 277 | #geqo_effort = 5 # range 1-10 278 | #geqo_pool_size = 0 # selects default based on effort 279 | #geqo_generations = 0 # selects default based on effort 280 | #geqo_selection_bias = 2.0 # range 1.5-2.0 281 | #geqo_seed = 0.0 # range 0.0-1.0 282 | 283 | # - Other Planner Options - 284 | 285 | #default_statistics_target = 100 # range 1-10000 286 | #constraint_exclusion = partition # on, off, or partition 287 | #cursor_tuple_fraction = 0.1 # range 0.0-1.0 288 | #from_collapse_limit = 8 289 | #join_collapse_limit = 8 # 1 disables collapsing of explicit 290 | # JOIN clauses 291 | 292 | 293 | #------------------------------------------------------------------------------ 294 | # ERROR REPORTING AND LOGGING 295 | #------------------------------------------------------------------------------ 296 | 297 | # - Where to Log - 298 | 299 | #log_destination = 'stderr' # Valid values are combinations of 300 | # stderr, csvlog, syslog, and eventlog, 301 | # depending on platform. csvlog 302 | # requires logging_collector to be on. 303 | 304 | # This is used when logging to stderr: 305 | #logging_collector = off # Enable capturing of stderr and csvlog 306 | # into log files. Required to be on for 307 | # csvlogs. 308 | # (change requires restart) 309 | 310 | # These are only used if logging_collector is on: 311 | #log_directory = 'pg_log' # directory where log files are written, 312 | # can be absolute or relative to PGDATA 313 | #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, 314 | # can include strftime() escapes 315 | #log_file_mode = 0600 # creation mode for log files, 316 | # begin with 0 to use octal notation 317 | #log_truncate_on_rotation = off # If on, an existing log file with the 318 | # same name as the new log file will be 319 | # truncated rather than appended to. 320 | # But such truncation only occurs on 321 | # time-driven rotation, not on restarts 322 | # or size-driven rotation. Default is 323 | # off, meaning append to existing files 324 | # in all cases. 325 | #log_rotation_age = 1d # Automatic rotation of logfiles will 326 | # happen after that time. 0 disables. 327 | #log_rotation_size = 10MB # Automatic rotation of logfiles will 328 | # happen after that much log output. 329 | # 0 disables. 330 | 331 | # These are relevant when logging to syslog: 332 | #syslog_facility = 'LOCAL0' 333 | #syslog_ident = 'postgres' 334 | 335 | # This is only relevant when logging to eventlog (win32): 336 | #event_source = 'PostgreSQL' 337 | 338 | # - When to Log - 339 | 340 | #client_min_messages = notice # values in order of decreasing detail: 341 | # debug5 342 | # debug4 343 | # debug3 344 | # debug2 345 | # debug1 346 | # log 347 | # notice 348 | # warning 349 | # error 350 | 351 | #log_min_messages = warning # values in order of decreasing detail: 352 | # debug5 353 | # debug4 354 | # debug3 355 | # debug2 356 | # debug1 357 | # info 358 | # notice 359 | # warning 360 | # error 361 | # log 362 | # fatal 363 | # panic 364 | 365 | #log_min_error_statement = error # values in order of decreasing detail: 366 | # debug5 367 | # debug4 368 | # debug3 369 | # debug2 370 | # debug1 371 | # info 372 | # notice 373 | # warning 374 | # error 375 | # log 376 | # fatal 377 | # panic (effectively off) 378 | 379 | #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements 380 | # and their durations, > 0 logs only 381 | # statements running at least this number 382 | # of milliseconds 383 | 384 | 385 | # - What to Log - 386 | 387 | #debug_print_parse = off 388 | #debug_print_rewritten = off 389 | #debug_print_plan = off 390 | #debug_pretty_print = on 391 | #log_checkpoints = off 392 | #log_connections = off 393 | #log_disconnections = off 394 | #log_duration = off 395 | #log_error_verbosity = default # terse, default, or verbose messages 396 | #log_hostname = off 397 | log_line_prefix = '%t ' # special values: 398 | # %a = application name 399 | # %u = user name 400 | # %d = database name 401 | # %r = remote host and port 402 | # %h = remote host 403 | # %p = process ID 404 | # %t = timestamp without milliseconds 405 | # %m = timestamp with milliseconds 406 | # %i = command tag 407 | # %e = SQL state 408 | # %c = session ID 409 | # %l = session line number 410 | # %s = session start timestamp 411 | # %v = virtual transaction ID 412 | # %x = transaction ID (0 if none) 413 | # %q = stop here in non-session 414 | # processes 415 | # %% = '%' 416 | # e.g. '<%u%%%d> ' 417 | #log_lock_waits = off # log lock waits >= deadlock_timeout 418 | #log_statement = 'none' # none, ddl, mod, all 419 | #log_temp_files = -1 # log temporary files equal or larger 420 | # than the specified size in kilobytes; 421 | # -1 disables, 0 logs all temp files 422 | log_timezone = 'UTC' 423 | 424 | 425 | #------------------------------------------------------------------------------ 426 | # RUNTIME STATISTICS 427 | #------------------------------------------------------------------------------ 428 | 429 | # - Query/Index Statistics Collector - 430 | 431 | #track_activities = on 432 | #track_counts = on 433 | #track_io_timing = off 434 | #track_functions = none # none, pl, all 435 | #track_activity_query_size = 1024 # (change requires restart) 436 | #update_process_title = on 437 | #stats_temp_directory = 'pg_stat_tmp' 438 | 439 | 440 | # - Statistics Monitoring - 441 | 442 | #log_parser_stats = off 443 | #log_planner_stats = off 444 | #log_executor_stats = off 445 | #log_statement_stats = off 446 | 447 | 448 | #------------------------------------------------------------------------------ 449 | # AUTOVACUUM PARAMETERS 450 | #------------------------------------------------------------------------------ 451 | 452 | #autovacuum = on # Enable autovacuum subprocess? 'on' 453 | # requires track_counts to also be on. 454 | #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and 455 | # their durations, > 0 logs only 456 | # actions running at least this number 457 | # of milliseconds. 458 | #autovacuum_max_workers = 3 # max number of autovacuum subprocesses 459 | # (change requires restart) 460 | #autovacuum_naptime = 1min # time between autovacuum runs 461 | #autovacuum_vacuum_threshold = 50 # min number of row updates before 462 | # vacuum 463 | #autovacuum_analyze_threshold = 50 # min number of row updates before 464 | # analyze 465 | #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum 466 | #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze 467 | #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum 468 | # (change requires restart) 469 | #autovacuum_multixact_freeze_max_age = 400000000 # maximum Multixact age 470 | # before forced vacuum 471 | # (change requires restart) 472 | #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for 473 | # autovacuum, in milliseconds; 474 | # -1 means use vacuum_cost_delay 475 | #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for 476 | # autovacuum, -1 means use 477 | # vacuum_cost_limit 478 | 479 | 480 | #------------------------------------------------------------------------------ 481 | # CLIENT CONNECTION DEFAULTS 482 | #------------------------------------------------------------------------------ 483 | 484 | # - Statement Behavior - 485 | 486 | #search_path = '"$user",public' # schema names 487 | #default_tablespace = '' # a tablespace name, '' uses the default 488 | #temp_tablespaces = '' # a list of tablespace names, '' uses 489 | # only default tablespace 490 | #check_function_bodies = on 491 | #default_transaction_isolation = 'read committed' 492 | #default_transaction_read_only = off 493 | #default_transaction_deferrable = off 494 | #session_replication_role = 'origin' 495 | #statement_timeout = 0 # in milliseconds, 0 is disabled 496 | #lock_timeout = 0 # in milliseconds, 0 is disabled 497 | #vacuum_freeze_min_age = 50000000 498 | #vacuum_freeze_table_age = 150000000 499 | #vacuum_multixact_freeze_min_age = 5000000 500 | #vacuum_multixact_freeze_table_age = 150000000 501 | #bytea_output = 'hex' # hex, escape 502 | #xmlbinary = 'base64' 503 | #xmloption = 'content' 504 | 505 | # - Locale and Formatting - 506 | 507 | datestyle = 'iso, mdy' 508 | #intervalstyle = 'postgres' 509 | timezone = 'UTC' 510 | #timezone_abbreviations = 'Default' # Select the set of available time zone 511 | # abbreviations. Currently, there are 512 | # Default 513 | # Australia 514 | # India 515 | # You can create your own file in 516 | # share/timezonesets/. 517 | #extra_float_digits = 0 # min -15, max 3 518 | #client_encoding = sql_ascii # actually, defaults to database 519 | # encoding 520 | 521 | # These settings are initialized by initdb, but they can be changed. 522 | lc_messages = 'en_US.UTF-8' # locale for system error message 523 | # strings 524 | lc_monetary = 'en_US.UTF-8' # locale for monetary formatting 525 | lc_numeric = 'en_US.UTF-8' # locale for number formatting 526 | lc_time = 'en_US.UTF-8' # locale for time formatting 527 | 528 | # default configuration for text search 529 | default_text_search_config = 'pg_catalog.english' 530 | 531 | # - Other Defaults - 532 | 533 | #dynamic_library_path = '$libdir' 534 | #local_preload_libraries = '' 535 | 536 | 537 | #------------------------------------------------------------------------------ 538 | # LOCK MANAGEMENT 539 | #------------------------------------------------------------------------------ 540 | 541 | #deadlock_timeout = 1s 542 | #max_locks_per_transaction = 64 # min 10 543 | # (change requires restart) 544 | # Note: Each lock table slot uses ~270 bytes of shared memory, and there are 545 | # max_locks_per_transaction * (max_connections + max_prepared_transactions) 546 | # lock table slots. 547 | #max_pred_locks_per_transaction = 64 # min 10 548 | # (change requires restart) 549 | 550 | 551 | #------------------------------------------------------------------------------ 552 | # VERSION/PLATFORM COMPATIBILITY 553 | #------------------------------------------------------------------------------ 554 | 555 | # - Previous PostgreSQL Versions - 556 | 557 | #array_nulls = on 558 | #backslash_quote = safe_encoding # on, off, or safe_encoding 559 | #default_with_oids = off 560 | #escape_string_warning = on 561 | #lo_compat_privileges = off 562 | #quote_all_identifiers = off 563 | #sql_inheritance = on 564 | #standard_conforming_strings = on 565 | #synchronize_seqscans = on 566 | 567 | # - Other Platforms and Clients - 568 | 569 | #transform_null_equals = off 570 | 571 | 572 | #------------------------------------------------------------------------------ 573 | # ERROR HANDLING 574 | #------------------------------------------------------------------------------ 575 | 576 | #exit_on_error = off # terminate session on any error? 577 | #restart_after_crash = on # reinitialize after backend crash? 578 | 579 | 580 | #------------------------------------------------------------------------------ 581 | # CONFIG FILE INCLUDES 582 | #------------------------------------------------------------------------------ 583 | 584 | # These options allow settings to be loaded from files other than the 585 | # default postgresql.conf. 586 | 587 | #include_dir = 'conf.d' # include files ending in '.conf' from 588 | # directory 'conf.d' 589 | #include_if_exists = 'exists.conf' # include file only if it exists 590 | #include = 'special.conf' # include file 591 | 592 | 593 | #------------------------------------------------------------------------------ 594 | # CUSTOMIZED OPTIONS 595 | #------------------------------------------------------------------------------ 596 | 597 | # Add settings for extensions here 598 | -------------------------------------------------------------------------------- /doc/qgis-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wilsaj/everything-is-osm/3ba17cf122b6c4d2a462810f0fafaec67525c5cc/doc/qgis-screenshot.png -------------------------------------------------------------------------------- /doc/tilemill-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wilsaj/everything-is-osm/3ba17cf122b6c4d2a462810f0fafaec67525c5cc/doc/tilemill-screenshot.png -------------------------------------------------------------------------------- /docker/Makefile: -------------------------------------------------------------------------------- 1 | DOCKER_DIR := ./ 2 | DOCKER_PRE := wilsaj/ 3 | 4 | all: docker-images 5 | 6 | docker-images: docker-everything-is-osm 7 | 8 | tmpnb: docker-everything-is-osm-tmpnb run-tmpnb 9 | 10 | run-tmpnb: 11 | docker ps | grep -E '(tmpnb|everything|configurable-http-proxy)' | awk '{print $$1}' | xargs docker stop 12 | $(eval TOKEN := $(shell head -c 30 /dev/urandom | xxd -p)) 13 | docker rm proxy 14 | docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=${TOKEN} --name=proxy jupyter/configurable-http-proxy --default-target http://127.0.0.1:9999 15 | docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=${TOKEN} \ 16 | -v /var/run/docker.sock:/docker.sock \ 17 | jupyter/tmpnb python orchestrate.py --image='wilsaj/everything-is-osm-tmpnb' --command="ipython3 notebook --NotebookApp.base_url={base_path} --ip=0.0.0.0 --port {port}" --pool_size=2 18 | 19 | 20 | run: 21 | docker run -p 5432:5432 --rm -it wilsaj/everything-is-osm 22 | 23 | %/ansible: ../ansible/ 24 | cp -r $< $@ 25 | 26 | everything-is-osm/variables.yml: ../variables.yml 27 | cp $< $@ 28 | 29 | everything-is-osm-tmpnb/variables.yml: ../variables.yml 30 | cp $< $@ 31 | 32 | docker-%: % %/ansible %/variables.yml 33 | docker build -t $(DOCKER_PRE)$* $< 34 | -------------------------------------------------------------------------------- /docker/everything-is-osm-tmpnb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM jupyter/minimal 2 | 3 | USER root 4 | 5 | # grab gosu for easy step-down from root 6 | RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 7 | RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ 8 | && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ 9 | && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ 10 | && gpg --verify /usr/local/bin/gosu.asc \ 11 | && rm /usr/local/bin/gosu.asc \ 12 | && chmod +x /usr/local/bin/gosu \ 13 | && apt-get purge -y --auto-remove curl 14 | 15 | RUN locale-gen en_US en_US.UTF-8 16 | RUN dpkg-reconfigure locales 17 | 18 | COPY ansible_hosts /ansible_hosts 19 | COPY bootstrap_ansible.sh /bootstrap_ansible.sh 20 | COPY ansible /ansible/ 21 | COPY variables.yml /variables.yml 22 | 23 | RUN apt-get update \ 24 | && apt-get -y install \ 25 | ansible \ 26 | golang \ 27 | git \ 28 | libgeos++-dev \ 29 | libleveldb-dev \ 30 | libprotobuf-dev \ 31 | libsqlite3-dev \ 32 | mercurial \ 33 | openssh-server \ 34 | postgresql-9.3 \ 35 | postgresql-9.3-postgis-2.1 \ 36 | python-apt \ 37 | python-psycopg2 \ 38 | && /bootstrap_ansible.sh setup import \ 39 | && apt-get -y purge --auto-remove \ 40 | ansible \ 41 | git \ 42 | golang \ 43 | libgeos++-dev \ 44 | libleveldb-dev \ 45 | libprotobuf-dev \ 46 | libsqlite3-dev \ 47 | mercurial \ 48 | openssh-server \ 49 | python-apt 50 | 51 | RUN pip install \ 52 | geojsonio \ 53 | ipython-sql \ 54 | psycopg2 \ 55 | shapely 56 | 57 | COPY docker-entrypoint.sh /docker-entrypoint.sh 58 | 59 | ADD notebooks/ /home/jovyan/ 60 | 61 | ENTRYPOINT ["/docker-entrypoint.sh"] 62 | CMD ["/bin/bash"] 63 | -------------------------------------------------------------------------------- /docker/everything-is-osm-tmpnb/ansible_hosts: -------------------------------------------------------------------------------- 1 | default ansible_ssh_host=localhost ansible_ssh_user=ansible 2 | -------------------------------------------------------------------------------- /docker/everything-is-osm-tmpnb/bootstrap_ansible.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # small script that bootstraps execution of ansible playbooks, for the benefit 4 | # of windows users 5 | 6 | ACTION=$1 7 | EXTRA_STORAGE=$2 8 | OSM_DIR=$3 9 | 10 | EXTRA_VARS="" 11 | 12 | for ACTION in "$@" 13 | do 14 | if [ ${ACTION} = "import" ]; then 15 | EXTRA_VARS=${EXTRA_VARS}"--extra-vars 'import=true' " 16 | fi 17 | if [ ${ACTION} = "setup" ]; then 18 | EXTRA_VARS=${EXTRA_VARS}"--extra-vars 'setup=true' " 19 | fi 20 | done 21 | 22 | #if [ ${EXTRA_STORAGE} = "1" ]; then 23 | #if [ ! -b /dev/sdb1 ]; then 24 | #parted /dev/sdb mklabel msdos 25 | #parted /dev/sdb mkpart primary 512 100% 26 | #sudo mkfs.ext4 /dev/sdb1 27 | #mkdir -p ${OSM_DIR} 28 | #echo "/dev/sdb1 ${OSM_DIR} ext4 defaults 0 0" >> /etc/fstab 29 | #mount ${OSM_DIR} 30 | #fi 31 | #fi 32 | 33 | ## install ansible 34 | #apt-get -y install ansible 35 | 36 | # create ansible user 37 | sudo adduser --disabled-password --gecos "" ansible 38 | 39 | # make sure sshd is running 40 | service ssh start 41 | 42 | echo 'ansible ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers 43 | 44 | # set things up so root can do key-based ssh (no password prompt) to 45 | # vagrant@localhost 46 | rm -f /root/.ssh/id_rsa* 47 | ssh-keygen -f /root/.ssh/id_rsa -P "" 48 | mkdir -p /home/ansible/.ssh/ --mode=755 49 | cat /root/.ssh/id_rsa.pub >> /home/ansible/.ssh/authorized_keys 50 | chmod 644 /home/ansible/.ssh/authorized_keys 51 | chown -R ansible:ansible /home/ansible/.ssh/ 52 | ssh-keyscan localhost > /root/.ssh/known_hosts 53 | 54 | # Ansible requires that an inventory file is not executable, so copy ansible 55 | # hosts file to /tmp and change permissions. This is necessary on Windows due to 56 | # the way filesystems are implemented: there isn't a way to change per-file 57 | # permissions on files in the shared /vagrant dir. 58 | #cp /vagrant/init/vagrant_ansible_hosts /tmp/vagrant_ansible_hosts 59 | #chmod -x /tmp/vagrant_ansible_hosts 60 | 61 | 62 | # set PYTHONUNBUFFERED env variable so output from the ansible script is passed 63 | # along in real time instead of all flushed at the very end 64 | export PYTHONUNBUFFERED=1 65 | 66 | ansible-playbook -i /ansible_hosts ${EXTRA_VARS} /ansible/everything-is-osm.yml 67 | -------------------------------------------------------------------------------- /docker/everything-is-osm-tmpnb/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | sudo service postgresql start 5 | 6 | gosu jovyan "$@" 7 | -------------------------------------------------------------------------------- /docker/everything-is-osm-tmpnb/notebooks/Everything is OSM.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 11, 6 | "metadata": { 7 | "collapsed": false 8 | }, 9 | "outputs": [ 10 | { 11 | "name": "stdout", 12 | "output_type": "stream", 13 | "text": [ 14 | "The sql extension is already loaded. To reload it, use:\n", 15 | " %reload_ext sql\n" 16 | ] 17 | } 18 | ], 19 | "source": [ 20 | "%load_ext sql" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": 12, 26 | "metadata": { 27 | "collapsed": false 28 | }, 29 | "outputs": [ 30 | { 31 | "data": { 32 | "text/plain": [ 33 | "u'Connected: osm@osm'" 34 | ] 35 | }, 36 | "execution_count": 12, 37 | "metadata": {}, 38 | "output_type": "execute_result" 39 | } 40 | ], 41 | "source": [ 42 | "%sql postgres://osm:osm@localhost:5432/osm" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": 23, 48 | "metadata": { 49 | "collapsed": false 50 | }, 51 | "outputs": [ 52 | { 53 | "name": "stdout", 54 | "output_type": "stream", 55 | "text": [ 56 | "27 rows affected.\n" 57 | ] 58 | }, 59 | { 60 | "data": { 61 | "text/html": [ 62 | "\n", 63 | " \n", 64 | " \n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | "
table_name
spatial_ref_sys
osm_waterareas
osm_waterways
osm_barrierways
osm_amenities
osm_buildings
osm_motorways
osm_landusages
osm_roads
osm_aeroways
osm_transport_points
osm_housenumbers
osm_housenumbers_interpolated
osm_admin
osm_transport_areas
osm_waterareas_gen1
osm_roads_gen0
osm_barrierpoints
osm_mainroads
osm_places
osm_minorroads
osm_landusages_gen1
osm_waterways_gen1
osm_waterareas_gen0
osm_roads_gen1
osm_landusages_gen0
osm_waterways_gen0
" 148 | ], 149 | "text/plain": [ 150 | "[(u'spatial_ref_sys',),\n", 151 | " (u'osm_waterareas',),\n", 152 | " (u'osm_waterways',),\n", 153 | " (u'osm_barrierways',),\n", 154 | " (u'osm_amenities',),\n", 155 | " (u'osm_buildings',),\n", 156 | " (u'osm_motorways',),\n", 157 | " (u'osm_landusages',),\n", 158 | " (u'osm_roads',),\n", 159 | " (u'osm_aeroways',),\n", 160 | " (u'osm_transport_points',),\n", 161 | " (u'osm_housenumbers',),\n", 162 | " (u'osm_housenumbers_interpolated',),\n", 163 | " (u'osm_admin',),\n", 164 | " (u'osm_transport_areas',),\n", 165 | " (u'osm_waterareas_gen1',),\n", 166 | " (u'osm_roads_gen0',),\n", 167 | " (u'osm_barrierpoints',),\n", 168 | " (u'osm_mainroads',),\n", 169 | " (u'osm_places',),\n", 170 | " (u'osm_minorroads',),\n", 171 | " (u'osm_landusages_gen1',),\n", 172 | " (u'osm_waterways_gen1',),\n", 173 | " (u'osm_waterareas_gen0',),\n", 174 | " (u'osm_roads_gen1',),\n", 175 | " (u'osm_landusages_gen0',),\n", 176 | " (u'osm_waterways_gen0',)]" 177 | ] 178 | }, 179 | "execution_count": 23, 180 | "metadata": {}, 181 | "output_type": "execute_result" 182 | } 183 | ], 184 | "source": [ 185 | "%sql SELECT table_name FROM information_schema.tables WHERE table_schema='public' AND table_type='BASE TABLE';" 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": 22, 191 | "metadata": { 192 | "collapsed": false 193 | }, 194 | "outputs": [ 195 | { 196 | "name": "stdout", 197 | "output_type": "stream", 198 | "text": [ 199 | "1 rows affected.\n" 200 | ] 201 | }, 202 | { 203 | "data": { 204 | "text/html": [ 205 | "\n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | "
count
11317
" 213 | ], 214 | "text/plain": [ 215 | "[(11317L,)]" 216 | ] 217 | }, 218 | "execution_count": 22, 219 | "metadata": {}, 220 | "output_type": "execute_result" 221 | } 222 | ], 223 | "source": [ 224 | "%sql SELECT COUNT(*) from osm_buildings;" 225 | ] 226 | } 227 | ], 228 | "metadata": { 229 | "kernelspec": { 230 | "display_name": "IPython (Python 2)", 231 | "name": "python2" 232 | }, 233 | "language_info": { 234 | "codemirror_mode": { 235 | "name": "ipython", 236 | "version": 2 237 | }, 238 | "file_extension": ".py", 239 | "mimetype": "text/x-python", 240 | "name": "python", 241 | "nbconvert_exporter": "python", 242 | "pygments_lexer": "ipython2", 243 | "version": "2.7.6" 244 | } 245 | }, 246 | "nbformat": 4, 247 | "nbformat_minor": 0 248 | } -------------------------------------------------------------------------------- /docker/everything-is-osm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | RUN apt-get update && \ 4 | apt-get -y install \ 5 | ansible \ 6 | python-apt \ 7 | openssh-server \ 8 | golang \ 9 | git \ 10 | libgeos++-dev \ 11 | libleveldb-dev \ 12 | libprotobuf-dev \ 13 | libsqlite3-dev \ 14 | mercurial \ 15 | postgresql-9.3 \ 16 | postgresql-9.3-postgis-2.1 \ 17 | python-psycopg2 18 | 19 | 20 | # grab gosu for easy step-down from root 21 | RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 22 | RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ 23 | && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ 24 | && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ 25 | && gpg --verify /usr/local/bin/gosu.asc \ 26 | && rm /usr/local/bin/gosu.asc \ 27 | && chmod +x /usr/local/bin/gosu \ 28 | && apt-get purge -y --auto-remove curl 29 | 30 | 31 | RUN locale-gen en_US en_US.UTF-8 32 | RUN dpkg-reconfigure locales 33 | 34 | COPY ansible_hosts /ansible_hosts 35 | COPY bootstrap_ansible.sh /bootstrap_ansible.sh 36 | COPY ansible /ansible/ 37 | 38 | COPY variables.yml /variables.yml 39 | RUN /bootstrap_ansible.sh setup import 40 | 41 | COPY docker-entrypoint.sh /docker-entrypoint.sh 42 | ENTRYPOINT ["/docker-entrypoint.sh"] 43 | CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"] 44 | -------------------------------------------------------------------------------- /docker/everything-is-osm/ansible_hosts: -------------------------------------------------------------------------------- 1 | default ansible_ssh_host=localhost ansible_ssh_user=ansible 2 | -------------------------------------------------------------------------------- /docker/everything-is-osm/bootstrap_ansible.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # small script that bootstraps execution of ansible playbooks, for the benefit 4 | # of windows users 5 | 6 | ACTION=$1 7 | EXTRA_STORAGE=$2 8 | OSM_DIR=$3 9 | 10 | EXTRA_VARS="" 11 | 12 | for ACTION in "$@" 13 | do 14 | if [ ${ACTION} = "import" ]; then 15 | EXTRA_VARS=${EXTRA_VARS}"--extra-vars 'import=true' " 16 | fi 17 | if [ ${ACTION} = "setup" ]; then 18 | EXTRA_VARS=${EXTRA_VARS}"--extra-vars 'setup=true' " 19 | fi 20 | done 21 | 22 | #if [ ${EXTRA_STORAGE} = "1" ]; then 23 | #if [ ! -b /dev/sdb1 ]; then 24 | #parted /dev/sdb mklabel msdos 25 | #parted /dev/sdb mkpart primary 512 100% 26 | #sudo mkfs.ext4 /dev/sdb1 27 | #mkdir -p ${OSM_DIR} 28 | #echo "/dev/sdb1 ${OSM_DIR} ext4 defaults 0 0" >> /etc/fstab 29 | #mount ${OSM_DIR} 30 | #fi 31 | #fi 32 | 33 | ## install ansible 34 | #apt-get -y install ansible 35 | 36 | # create ansible user 37 | sudo adduser --disabled-password --gecos "" ansible 38 | 39 | # make sure sshd is running 40 | service ssh start 41 | 42 | echo 'ansible ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers 43 | 44 | # set things up so root can do key-based ssh (no password prompt) to 45 | # vagrant@localhost 46 | rm -f /root/.ssh/id_rsa* 47 | ssh-keygen -f /root/.ssh/id_rsa -P "" 48 | mkdir -p /home/ansible/.ssh/ --mode=755 49 | cat /root/.ssh/id_rsa.pub >> /home/ansible/.ssh/authorized_keys 50 | chmod 644 /home/ansible/.ssh/authorized_keys 51 | chown -R ansible:ansible /home/ansible/.ssh/ 52 | ssh-keyscan localhost > /root/.ssh/known_hosts 53 | 54 | # Ansible requires that an inventory file is not executable, so copy ansible 55 | # hosts file to /tmp and change permissions. This is necessary on Windows due to 56 | # the way filesystems are implemented: there isn't a way to change per-file 57 | # permissions on files in the shared /vagrant dir. 58 | #cp /vagrant/init/vagrant_ansible_hosts /tmp/vagrant_ansible_hosts 59 | #chmod -x /tmp/vagrant_ansible_hosts 60 | 61 | 62 | # set PYTHONUNBUFFERED env variable so output from the ansible script is passed 63 | # along in real time instead of all flushed at the very end 64 | export PYTHONUNBUFFERED=1 65 | 66 | ansible-playbook -i /ansible_hosts ${EXTRA_VARS} /ansible/everything-is-osm.yml 67 | -------------------------------------------------------------------------------- /docker/everything-is-osm/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | 5 | if [ $1 = '/usr/lib/postgresql/9.3/bin/postgres' ]; then 6 | gosu postgres "$@" 7 | else 8 | exec "$@" 9 | fi 10 | -------------------------------------------------------------------------------- /docker/imposm3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | ENV IMPOSM_VERSION 32623ccce097584be79ec8617dfae42d595ac2b8 4 | 5 | # Build imposm3 binary and clean up afterwards 6 | RUN apt-get update \ 7 | && apt-get install -y golang \ 8 | && apt-get install -y git \ 9 | && apt-get install -y libgeos++-dev \ 10 | && apt-get install -y libleveldb-dev \ 11 | && apt-get install -y libprotobuf-dev \ 12 | && apt-get install -y libsqlite3-dev \ 13 | && apt-get install -y mercurial \ 14 | && mkdir /imposm \ 15 | && git clone https://github.com/omniscale/imposm3 /imposm/src/imposm3 \ 16 | && cd /imposm/src/imposm3 \ 17 | && git checkout $IMPOSM_VERSION \ 18 | && GOPATH=/imposm go get imposm3 \ 19 | && GOPATH=/imposm go build -o /imposm3 imposm3 \ 20 | && cd / \ 21 | && rm -rf /imposm \ 22 | && apt-get purge -y --auto-remove golang \ 23 | && apt-get purge -y --auto-remove git \ 24 | && apt-get purge -y --auto-remove mercurial 25 | 26 | RUN apt-get update \ 27 | && apt-get install -y curl 28 | 29 | VOLUME /everything-is-osm 30 | 31 | COPY import.sh /import.sh 32 | COPY mapping.json /everything-is-osm/mapping.json 33 | RUN mkdir -p /everything-is-osm/metro 34 | -------------------------------------------------------------------------------- /docker/imposm3/import.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TYPE=$1 4 | AREA=$2 5 | 6 | DATA_DIR=/everything-is-osm 7 | METRO_DIR=$DATA_DIR/metro 8 | 9 | IMPOSM_BIN=/imposm3 10 | IMPOSM_CACHE_DIR=$DATA_DIR/cache 11 | MAPPING_JSON=/everything-is-osm/mapping.json 12 | 13 | if [[ $TYPE == 'metro' ]]; then 14 | TYPE_DIR=$METRO_DIR 15 | FILENAME=${AREA}.osm.pbf 16 | URL="https://s3.amazonaws.com/metro-extracts.mapzen.com/${FILENAME}" 17 | fi 18 | 19 | 20 | PBF_FILEPATH=$TYPE_DIR/$FILENAME 21 | DIR=$(dirname $PBF_FILEPATH) 22 | 23 | mkdir -p $DIR 24 | cd $DIR && curl -O $URL 25 | 26 | mkdir -p $IMPOSM_CACHE_DIR 27 | 28 | DB_SCHEMA=public 29 | PG_CONNECT="postgis://osm:osm@$DB_PORT_5432_TCP_ADDR/osm" 30 | $IMPOSM_BIN import -connection $PG_CONNECT -mapping $MAPPING_JSON -appendcache -cachedir=$IMPOSM_CACHE_DIR -read $PBF_FILEPATH 31 | $IMPOSM_BIN import -connection $PG_CONNECT -mapping $MAPPING_JSON -appendcache -cachedir=$IMPOSM_CACHE_DIR -write -dbschema-import=${DB_SCHEMA} 32 | -------------------------------------------------------------------------------- /docker/imposm3/mapping.json: -------------------------------------------------------------------------------- 1 | { 2 | "generalized_tables": { 3 | "waterareas_gen1": { 4 | "source": "waterareas", 5 | "sql_filter": "ST_Area(geometry)>50000.000000", 6 | "tolerance": 50.0 7 | }, 8 | "waterareas_gen0": { 9 | "source": "waterareas_gen1", 10 | "sql_filter": "ST_Area(geometry)>500000.000000", 11 | "tolerance": 200.0 12 | }, 13 | "roads_gen0": { 14 | "source": "roads_gen1", 15 | "sql_filter": null, 16 | "tolerance": 200.0 17 | }, 18 | "roads_gen1": { 19 | "source": "roads", 20 | "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link') OR class IN('railway')", 21 | "tolerance": 50.0 22 | }, 23 | "waterways_gen0": { 24 | "source": "waterways_gen1", 25 | "sql_filter": null, 26 | "tolerance": 200 27 | }, 28 | "waterways_gen1": { 29 | "source": "waterways", 30 | "sql_filter": null, 31 | "tolerance": 50.0 32 | }, 33 | "landusages_gen1": { 34 | "source": "landusages", 35 | "sql_filter": "ST_Area(geometry)>50000.000000", 36 | "tolerance": 50.0 37 | }, 38 | "landusages_gen0": { 39 | "source": "landusages_gen1", 40 | "sql_filter": "ST_Area(geometry)>500000.000000", 41 | "tolerance": 200.0 42 | } 43 | }, 44 | "tables": { 45 | "landusages": { 46 | "fields": [ 47 | { 48 | "type": "id", 49 | "name": "osm_id", 50 | "key": null 51 | }, 52 | { 53 | "type": "geometry", 54 | "name": "geometry", 55 | "key": null 56 | }, 57 | { 58 | "type": "string", 59 | "name": "name", 60 | "key": "name" 61 | }, 62 | { 63 | "type": "mapping_value", 64 | "name": "type", 65 | "key": null 66 | }, 67 | { 68 | "type": "pseudoarea", 69 | "name": "area", 70 | "key": null 71 | }, 72 | { 73 | "args": { 74 | "ranks": [ 75 | "pedestrian", 76 | "footway", 77 | "playground", 78 | "park", 79 | "forest", 80 | "cemetery", 81 | "farmyard", 82 | "farm", 83 | "farmland", 84 | "wood", 85 | "meadow", 86 | "grass", 87 | "wetland", 88 | "village_green", 89 | "recreation_ground", 90 | "garden", 91 | "sports_centre", 92 | "pitch", 93 | "common", 94 | "allotments", 95 | "golf_course", 96 | "university", 97 | "school", 98 | "college", 99 | "library", 100 | "baracks", 101 | "fuel", 102 | "parking", 103 | "nature_reserve", 104 | "cinema", 105 | "theatre", 106 | "place_of_worship", 107 | "hospital", 108 | "scrub", 109 | "orchard", 110 | "vineyard", 111 | "zoo", 112 | "quarry", 113 | "residential", 114 | "retail", 115 | "commercial", 116 | "industrial", 117 | "railway", 118 | "heath", 119 | "island", 120 | "land" 121 | ] 122 | }, 123 | "type": "zorder", 124 | "name": "z_order", 125 | "key": "z_order" 126 | } 127 | ], 128 | "type": "polygon", 129 | "mapping": { 130 | "amenity": [ 131 | "university", 132 | "school", 133 | "college", 134 | "library", 135 | "fuel", 136 | "parking", 137 | "cinema", 138 | "theatre", 139 | "place_of_worship", 140 | "hospital" 141 | ], 142 | "barrier": [ 143 | "hedge" 144 | ], 145 | "leisure": [ 146 | "park", 147 | "garden", 148 | "playground", 149 | "golf_course", 150 | "sports_centre", 151 | "pitch", 152 | "stadium", 153 | "common", 154 | "nature_reserve" 155 | ], 156 | "tourism": [ 157 | "zoo" 158 | ], 159 | "natural": [ 160 | "wood", 161 | "land", 162 | "scrub", 163 | "wetland", 164 | "heath" 165 | ], 166 | "man_made": [ 167 | "pier" 168 | ], 169 | "aeroway": [ 170 | "runway", 171 | "taxiway" 172 | ], 173 | "place": [ 174 | "island" 175 | ], 176 | "military": [ 177 | "barracks" 178 | ], 179 | "landuse": [ 180 | "park", 181 | "forest", 182 | "residential", 183 | "retail", 184 | "commercial", 185 | "industrial", 186 | "railway", 187 | "cemetery", 188 | "grass", 189 | "farmyard", 190 | "farm", 191 | "farmland", 192 | "orchard", 193 | "vineyard", 194 | "wood", 195 | "meadow", 196 | "village_green", 197 | "recreation_ground", 198 | "allotments", 199 | "quarry" 200 | ], 201 | "highway": [ 202 | "pedestrian", 203 | "footway" 204 | ] 205 | } 206 | }, 207 | "buildings": { 208 | "fields": [ 209 | { 210 | "type": "id", 211 | "name": "osm_id", 212 | "key": null 213 | }, 214 | { 215 | "type": "geometry", 216 | "name": "geometry", 217 | "key": null 218 | }, 219 | { 220 | "type": "string", 221 | "name": "name", 222 | "key": "name" 223 | }, 224 | { 225 | "type": "pseudoarea", 226 | "name": "area", 227 | "key": "area" 228 | }, 229 | { 230 | "type": "mapping_value", 231 | "name": "type", 232 | "key": null 233 | } 234 | ], 235 | "type": "polygon", 236 | "mapping": { 237 | "building": [ 238 | "__any__" 239 | ] 240 | } 241 | }, 242 | "places": { 243 | "fields": [ 244 | { 245 | "type": "id", 246 | "name": "osm_id", 247 | "key": null 248 | }, 249 | { 250 | "type": "geometry", 251 | "name": "geometry", 252 | "key": null 253 | }, 254 | { 255 | "type": "string", 256 | "name": "name", 257 | "key": "name" 258 | }, 259 | { 260 | "type": "mapping_value", 261 | "name": "type", 262 | "key": null 263 | }, 264 | { 265 | "args": { 266 | "ranks": [ 267 | "country", 268 | "state", 269 | "region", 270 | "county", 271 | "city", 272 | "town", 273 | "village", 274 | "hamlet", 275 | "suburb", 276 | "locality" 277 | ] 278 | }, 279 | "type": "zorder", 280 | "name": "z_order", 281 | "key": "z_order" 282 | }, 283 | { 284 | "type": "integer", 285 | "name": "population", 286 | "key": "population" 287 | } 288 | ], 289 | "type": "point", 290 | "mapping": { 291 | "place": [ 292 | "country", 293 | "state", 294 | "region", 295 | "county", 296 | "city", 297 | "town", 298 | "village", 299 | "hamlet", 300 | "suburb", 301 | "locality" 302 | ] 303 | } 304 | }, 305 | "transport_areas": { 306 | "fields": [ 307 | { 308 | "type": "id", 309 | "name": "osm_id", 310 | "key": null 311 | }, 312 | { 313 | "type": "geometry", 314 | "name": "geometry", 315 | "key": null 316 | }, 317 | { 318 | "type": "string", 319 | "name": "name", 320 | "key": "name" 321 | }, 322 | { 323 | "type": "mapping_value", 324 | "name": "type", 325 | "key": null 326 | } 327 | ], 328 | "type": "polygon", 329 | "mapping": { 330 | "railway": [ 331 | "station", 332 | "platform" 333 | ], 334 | "aeroway": [ 335 | "aerodrome", 336 | "terminal", 337 | "helipad", 338 | "apron" 339 | ] 340 | } 341 | }, 342 | "admin": { 343 | "fields": [ 344 | { 345 | "type": "id", 346 | "name": "osm_id", 347 | "key": null 348 | }, 349 | { 350 | "type": "geometry", 351 | "name": "geometry", 352 | "key": null 353 | }, 354 | { 355 | "type": "string", 356 | "name": "name", 357 | "key": "name" 358 | }, 359 | { 360 | "type": "mapping_value", 361 | "name": "type", 362 | "key": null 363 | }, 364 | { 365 | "type": "integer", 366 | "name": "admin_level", 367 | "key": "admin_level" 368 | } 369 | ], 370 | "type": "polygon", 371 | "mapping": { 372 | "boundary": [ 373 | "administrative" 374 | ] 375 | } 376 | }, 377 | "aeroways": { 378 | "fields": [ 379 | { 380 | "type": "id", 381 | "name": "osm_id", 382 | "key": null 383 | }, 384 | { 385 | "type": "geometry", 386 | "name": "geometry", 387 | "key": null 388 | }, 389 | { 390 | "type": "string", 391 | "name": "name", 392 | "key": "name" 393 | }, 394 | { 395 | "type": "mapping_value", 396 | "name": "type", 397 | "key": null 398 | } 399 | ], 400 | "type": "linestring", 401 | "mapping": { 402 | "aeroway": [ 403 | "runway", 404 | "taxiway" 405 | ] 406 | } 407 | }, 408 | "waterways": { 409 | "fields": [ 410 | { 411 | "type": "id", 412 | "name": "osm_id", 413 | "key": null 414 | }, 415 | { 416 | "type": "geometry", 417 | "name": "geometry", 418 | "key": null 419 | }, 420 | { 421 | "type": "string", 422 | "name": "name", 423 | "key": "name" 424 | }, 425 | { 426 | "type": "mapping_value", 427 | "name": "type", 428 | "key": null 429 | } 430 | ], 431 | "type": "linestring", 432 | "mapping": { 433 | "waterway": [ 434 | "stream", 435 | "river", 436 | "canal", 437 | "drain", 438 | "ditch" 439 | ], 440 | "barrier": [ 441 | "ditch" 442 | ] 443 | } 444 | }, 445 | "barrierways": { 446 | "fields": [ 447 | { 448 | "type": "id", 449 | "name": "osm_id", 450 | "key": null 451 | }, 452 | { 453 | "type": "geometry", 454 | "name": "geometry", 455 | "key": null 456 | }, 457 | { 458 | "type": "string", 459 | "name": "name", 460 | "key": "name" 461 | }, 462 | { 463 | "type": "mapping_value", 464 | "name": "type", 465 | "key": null 466 | } 467 | ], 468 | "type": "linestring", 469 | "mapping": { 470 | "barrier": [ 471 | "city_wall", 472 | "fence", 473 | "hedge", 474 | "retaining_wall", 475 | "wall", 476 | "bollard", 477 | "gate", 478 | "spikes", 479 | "lift_gate", 480 | "kissing_gate", 481 | "embankment", 482 | "yes", 483 | "wire_fence" 484 | ] 485 | } 486 | }, 487 | "transport_points": { 488 | "fields": [ 489 | { 490 | "type": "id", 491 | "name": "osm_id", 492 | "key": null 493 | }, 494 | { 495 | "type": "geometry", 496 | "name": "geometry", 497 | "key": null 498 | }, 499 | { 500 | "type": "string", 501 | "name": "name", 502 | "key": "name" 503 | }, 504 | { 505 | "type": "mapping_value", 506 | "name": "type", 507 | "key": null 508 | }, 509 | { 510 | "type": "string", 511 | "name": "ref", 512 | "key": "ref" 513 | } 514 | ], 515 | "type": "point", 516 | "mapping": { 517 | "railway": [ 518 | "station", 519 | "halt", 520 | "tram_stop", 521 | "crossing", 522 | "level_crossing", 523 | "subway_entrance" 524 | ], 525 | "aeroway": [ 526 | "aerodrome", 527 | "terminal", 528 | "helipad", 529 | "gate" 530 | ], 531 | "highway": [ 532 | "motorway_junction", 533 | "turning_circle", 534 | "bus_stop" 535 | ] 536 | } 537 | }, 538 | "amenities": { 539 | "fields": [ 540 | { 541 | "type": "id", 542 | "name": "osm_id", 543 | "key": null 544 | }, 545 | { 546 | "type": "geometry", 547 | "name": "geometry", 548 | "key": null 549 | }, 550 | { 551 | "type": "string", 552 | "name": "name", 553 | "key": "name" 554 | }, 555 | { 556 | "type": "mapping_value", 557 | "name": "type", 558 | "key": null 559 | } 560 | ], 561 | "type": "point", 562 | "mapping": { 563 | "amenity": [ 564 | "university", 565 | "school", 566 | "library", 567 | "fuel", 568 | "hospital", 569 | "fire_station", 570 | "police", 571 | "townhall" 572 | ] 573 | } 574 | }, 575 | "barrierpoints": { 576 | "fields": [ 577 | { 578 | "type": "id", 579 | "name": "osm_id", 580 | "key": null 581 | }, 582 | { 583 | "type": "geometry", 584 | "name": "geometry", 585 | "key": null 586 | }, 587 | { 588 | "type": "string", 589 | "name": "name", 590 | "key": "name" 591 | }, 592 | { 593 | "type": "mapping_value", 594 | "name": "type", 595 | "key": null 596 | } 597 | ], 598 | "type": "point", 599 | "mapping": { 600 | "barrier": [ 601 | "block", 602 | "bollard", 603 | "cattle_grid", 604 | "chain", 605 | "cycle_barrier", 606 | "entrance", 607 | "horse_stile", 608 | "gate", 609 | "spikes", 610 | "lift_gate", 611 | "kissing_gate", 612 | "fence", 613 | "yes", 614 | "wire_fence", 615 | "toll_booth", 616 | "stile" 617 | ] 618 | } 619 | }, 620 | "housenumbers_interpolated": { 621 | "fields": [ 622 | { 623 | "type": "id", 624 | "name": "osm_id", 625 | "key": null 626 | }, 627 | { 628 | "type": "geometry", 629 | "name": "geometry", 630 | "key": null 631 | }, 632 | { 633 | "type": "string", 634 | "name": "name", 635 | "key": "name" 636 | }, 637 | { 638 | "type": "mapping_value", 639 | "name": "type", 640 | "key": null 641 | }, 642 | { 643 | "type": "string", 644 | "name": "addr:street", 645 | "key": "addr:street" 646 | }, 647 | { 648 | "type": "string", 649 | "name": "addr:postcode", 650 | "key": "addr:postcode" 651 | }, 652 | { 653 | "type": "string", 654 | "name": "addr:city", 655 | "key": "addr:city" 656 | }, 657 | { 658 | "type": "string", 659 | "name": "addr:inclusion", 660 | "key": "addr:inclusion" 661 | } 662 | ], 663 | "type": "linestring", 664 | "mapping": { 665 | "addr:interpolation": [ 666 | "__any__" 667 | ] 668 | } 669 | }, 670 | "roads": { 671 | "fields": [ 672 | { 673 | "type": "id", 674 | "name": "osm_id", 675 | "key": null 676 | }, 677 | { 678 | "type": "geometry", 679 | "name": "geometry", 680 | "key": null 681 | }, 682 | { 683 | "type": "mapping_value", 684 | "name": "type", 685 | "key": null 686 | }, 687 | { 688 | "type": "string", 689 | "name": "name", 690 | "key": "name" 691 | }, 692 | { 693 | "type": "boolint", 694 | "name": "tunnel", 695 | "key": "tunnel" 696 | }, 697 | { 698 | "type": "boolint", 699 | "name": "bridge", 700 | "key": "bridge" 701 | }, 702 | { 703 | "type": "direction", 704 | "name": "oneway", 705 | "key": "oneway" 706 | }, 707 | { 708 | "type": "string", 709 | "name": "ref", 710 | "key": "ref" 711 | }, 712 | { 713 | "type": "integer", 714 | "name": "layer", 715 | "key": "layer" 716 | }, 717 | { 718 | "type": "wayzorder", 719 | "name": "z_order", 720 | "key": "z_order" 721 | }, 722 | { 723 | "type": "string", 724 | "name": "access", 725 | "key": "access" 726 | }, 727 | { 728 | "type": "string", 729 | "name": "service", 730 | "key": "service" 731 | }, 732 | { 733 | "type": "mapping_key", 734 | "name": "class", 735 | "key": null 736 | } 737 | ], 738 | "type": "linestring", 739 | "filters": { 740 | "exclude_tags": [ 741 | ["area", "yes"] 742 | ] 743 | }, 744 | "mappings": { 745 | "railway": { 746 | "mapping": { 747 | "railway": [ 748 | "rail", 749 | "tram", 750 | "light_rail", 751 | "subway", 752 | "narrow_gauge", 753 | "preserved", 754 | "funicular", 755 | "monorail", 756 | "disused" 757 | ] 758 | } 759 | }, 760 | "roads": { 761 | "mapping": { 762 | "man_made": [ 763 | "pier", 764 | "groyne" 765 | ], 766 | "highway": [ 767 | "motorway", 768 | "motorway_link", 769 | "trunk", 770 | "trunk_link", 771 | "primary", 772 | "primary_link", 773 | "secondary", 774 | "secondary_link", 775 | "tertiary", 776 | "tertiary_link", 777 | "road", 778 | "path", 779 | "track", 780 | "service", 781 | "footway", 782 | "bridleway", 783 | "cycleway", 784 | "steps", 785 | "pedestrian", 786 | "living_street", 787 | "unclassified", 788 | "residential", 789 | "raceway" 790 | ] 791 | } 792 | } 793 | } 794 | }, 795 | "motorways": { 796 | "fields": [ 797 | { 798 | "type": "id", 799 | "name": "osm_id", 800 | "key": null 801 | }, 802 | { 803 | "type": "geometry", 804 | "name": "geometry", 805 | "key": null 806 | }, 807 | { 808 | "type": "mapping_value", 809 | "name": "type", 810 | "key": null 811 | }, 812 | { 813 | "type": "string", 814 | "name": "name", 815 | "key": "name" 816 | }, 817 | { 818 | "type": "direction", 819 | "name": "oneway", 820 | "key": "oneway" 821 | }, 822 | { 823 | "type": "string", 824 | "name": "ref", 825 | "key": "ref" 826 | } 827 | ], 828 | "type": "linestring", 829 | "filters": { 830 | "exclude_tags": [ 831 | ["area", "yes"] 832 | ] 833 | }, 834 | "mapping": { 835 | "highway": [ 836 | "motorway", 837 | "motorway_link", 838 | "trunk", 839 | "trunk_link" 840 | ] 841 | } 842 | }, 843 | "mainroads": { 844 | "fields": [ 845 | { 846 | "type": "id", 847 | "name": "osm_id", 848 | "key": null 849 | }, 850 | { 851 | "type": "geometry", 852 | "name": "geometry", 853 | "key": null 854 | }, 855 | { 856 | "type": "mapping_value", 857 | "name": "type", 858 | "key": null 859 | }, 860 | { 861 | "type": "string", 862 | "name": "name", 863 | "key": "name" 864 | }, 865 | { 866 | "type": "direction", 867 | "name": "oneway", 868 | "key": "oneway" 869 | } 870 | ], 871 | "type": "linestring", 872 | "filters": { 873 | "exclude_tags": [ 874 | ["area", "yes"] 875 | ] 876 | }, 877 | "mapping": { 878 | "highway": [ 879 | "primary", 880 | "primary_link", 881 | "secondary", 882 | "secondary_link", 883 | "tertiary", 884 | "tertiary_link" 885 | ] 886 | } 887 | }, 888 | "minorroads": { 889 | "fields": [ 890 | { 891 | "type": "id", 892 | "name": "osm_id", 893 | "key": null 894 | }, 895 | { 896 | "type": "geometry", 897 | "name": "geometry", 898 | "key": null 899 | }, 900 | { 901 | "type": "mapping_value", 902 | "name": "type", 903 | "key": null 904 | }, 905 | { 906 | "type": "string", 907 | "name": "name", 908 | "key": "name" 909 | }, 910 | { 911 | "type": "direction", 912 | "name": "oneway", 913 | "key": "oneway" 914 | } 915 | ], 916 | "type": "linestring", 917 | "filters": { 918 | "exclude_tags": [ 919 | ["area", "yes"] 920 | ] 921 | }, 922 | "mapping": { 923 | "highway": [ 924 | "road", 925 | "path", 926 | "track", 927 | "service", 928 | "footway", 929 | "bridleway", 930 | "cycleway", 931 | "steps", 932 | "pedestrian", 933 | "living_street", 934 | "unclassified", 935 | "residential" 936 | ] 937 | } 938 | }, 939 | "housenumbers": { 940 | "fields": [ 941 | { 942 | "type": "id", 943 | "name": "osm_id", 944 | "key": null 945 | }, 946 | { 947 | "type": "geometry", 948 | "name": "geometry", 949 | "key": null 950 | }, 951 | { 952 | "type": "string", 953 | "name": "name", 954 | "key": "name" 955 | }, 956 | { 957 | "type": "mapping_value", 958 | "name": "type", 959 | "key": null 960 | }, 961 | { 962 | "type": "string", 963 | "name": "addr:street", 964 | "key": "addr:street" 965 | }, 966 | { 967 | "type": "string", 968 | "name": "addr:postcode", 969 | "key": "addr:postcode" 970 | }, 971 | { 972 | "type": "string", 973 | "name": "addr:city", 974 | "key": "addr:city" 975 | } 976 | ], 977 | "type": "point", 978 | "mapping": { 979 | "addr:housenumber": [ 980 | "__any__" 981 | ] 982 | } 983 | }, 984 | "waterareas": { 985 | "fields": [ 986 | { 987 | "type": "id", 988 | "name": "osm_id", 989 | "key": null 990 | }, 991 | { 992 | "type": "geometry", 993 | "name": "geometry", 994 | "key": null 995 | }, 996 | { 997 | "type": "string", 998 | "name": "name", 999 | "key": "name" 1000 | }, 1001 | { 1002 | "type": "mapping_value", 1003 | "name": "type", 1004 | "key": null 1005 | }, 1006 | { 1007 | "type": "pseudoarea", 1008 | "name": "area", 1009 | "key": null 1010 | } 1011 | ], 1012 | "type": "polygon", 1013 | "mapping": { 1014 | "waterway": [ 1015 | "riverbank" 1016 | ], 1017 | "landuse": [ 1018 | "basin", 1019 | "reservoir" 1020 | ], 1021 | "natural": [ 1022 | "water" 1023 | ], 1024 | "amenity": [ 1025 | "swimming_pool" 1026 | ], 1027 | "leisure": [ 1028 | "swimming_pool" 1029 | ] 1030 | } 1031 | } 1032 | } 1033 | } 1034 | -------------------------------------------------------------------------------- /docker/postgis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:9.3 2 | 3 | RUN apt-get update \ 4 | && apt-get install -y postgis 5 | 6 | COPY init-database.sh /docker-entrypoint-initdb.d/init-database.sh 7 | -------------------------------------------------------------------------------- /docker/postgis/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [ "$1" = 'postgres' ]; then 5 | chown -R postgres "$PGDATA" 6 | 7 | if [ -z "$(ls -A "$PGDATA")" ]; then 8 | gosu postgres initdb 9 | 10 | sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf 11 | 12 | { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf 13 | 14 | if [ -d /docker-entrypoint-initdb.d ]; then 15 | for f in /docker-entrypoint-initdb.d/*.sh; do 16 | [ -f "$f" ] && . "$f" 17 | done 18 | fi 19 | fi 20 | 21 | exec gosu postgres "$@" 22 | fi 23 | 24 | exec "$@" 25 | -------------------------------------------------------------------------------- /docker/postgis/init-database.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | USERNAME="osm" 4 | PASSWORD="osm" 5 | DB_NAME="osm" 6 | 7 | CREATE_USER="CREATE USER $USERNAME WITH PASSWORD '$PASSWORD'" 8 | echo "$CREATE_USER" | gosu postgres /usr/lib/postgresql/9.3/bin/postgres --single -D /var/lib/postgresql/data/ postgres 9 | 10 | CREATE_DATABASE="CREATE DATABASE $DB_NAME OWNER $USERNAME" 11 | echo "$CREATE_DATABASE" | gosu postgres /usr/lib/postgresql/9.3/bin/postgres --single -D /var/lib/postgresql/data/ postgres 12 | 13 | # creating the postgis extension doesn't seem to work in single user mode, so we 14 | # need to actually run the server to do it 15 | 16 | # start server 17 | gosu postgres pg_ctl -D /var/lib/postgresql/data start 18 | 19 | # give it a moment to be able to accept connections 20 | sleep 0.1 21 | 22 | CREATE_POSTGIS="CREATE EXTENSION IF NOT EXISTS postgis" 23 | gosu postgres /usr/lib/postgresql/9.3/bin/psql -c "$CREATE_POSTGIS" $DB_NAME 24 | 25 | CREATE_HSTORE="CREATE EXTENSION IF NOT EXISTS hstore" 26 | gosu postgres /usr/lib/postgresql/9.3/bin/psql -c "$CREATE_HSTORE" $DB_NAME 27 | 28 | # stop server 29 | gosu postgres pg_ctl -D /var/lib/postgresql/data stop 30 | -------------------------------------------------------------------------------- /init/bootstrap_ansible.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # small script that bootstraps execution of ansible playbooks, for the benefit 4 | # of windows users 5 | 6 | EXTRA_STORAGE=$1 7 | OSM_DIR=$2 8 | 9 | if [ ${EXTRA_STORAGE} = "1" ]; then 10 | if [ ! -b /dev/sdb1 ]; then 11 | parted /dev/sdb mklabel msdos 12 | parted /dev/sdb mkpart primary 512 100% 13 | sudo mkfs.ext4 /dev/sdb1 14 | mkdir -p ${OSM_DIR} 15 | echo "/dev/sdb1 ${OSM_DIR} ext4 defaults 0 0" >> /etc/fstab 16 | mount ${OSM_DIR} 17 | fi 18 | fi 19 | 20 | # install ansible 21 | apt-get -y install ansible 22 | 23 | # set things up so root can do key-based ssh (no password prompt) to 24 | # vagrant@localhost 25 | rm -f /root/.ssh/id_rsa* 26 | ssh-keygen -f /root/.ssh/id_rsa -P "" 27 | cat /root/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys 28 | ssh-keyscan localhost > /root/.ssh/known_hosts 29 | 30 | 31 | # Ansible requires that an inventory file is not executable, so copy ansible 32 | # hosts file to /tmp and change permissions. This is necessary on Windows due to 33 | # the way filesystems are implemented: there isn't a way to change per-file 34 | # permissions on files in the shared /vagrant dir. 35 | cp /vagrant/init/vagrant_ansible_hosts /tmp/vagrant_ansible_hosts 36 | chmod -x /tmp/vagrant_ansible_hosts 37 | 38 | 39 | # set PYTHONUNBUFFERED env variable so output from the ansible script is passed 40 | # along in real time instead of all flushed at the very end 41 | export PYTHONUNBUFFERED=1 42 | 43 | # run the ansible playbook to start making things osm 44 | ansible-playbook -i /tmp/vagrant_ansible_hosts -u vagrant /vagrant/ansible/everything-is-osm.yml 45 | -------------------------------------------------------------------------------- /init/vagrant_ansible_hosts: -------------------------------------------------------------------------------- 1 | default ansible_ssh_host=localhost ansible_ssh_user=vagrant 2 | -------------------------------------------------------------------------------- /variables.yml: -------------------------------------------------------------------------------- 1 | --- 2 | db_name: "osm" 3 | db_user: "osm" 4 | db_password: "osm" 5 | db_port: 5432 6 | db_schema: "public" 7 | 8 | # amount of dedicated RAM, in MB, that will be devoted to the virtual machine 9 | vm_ram: 4096 10 | 11 | # number of dedicated CPUs that will be devoted to the virtual machine 12 | vm_cpus: 2 13 | 14 | # list of metro areas to download from https://mapzen.com/metro-extracts/ 15 | # the extract downloaded from the url: 16 | # https://s3.amazonaws.com/metro-extracts.mapzen.com/.osm.pbf 17 | metro_extracts: 18 | - "austin_texas" 19 | #- "portland_oregon" 20 | 21 | 22 | # list of extracts to download from http://download.geofabrik.de/ 23 | # the extract name can include subregions and will be downloaded from: 24 | # http://download.geofabrik.de/-latest.osm.pbf 25 | geofabrik_extracts: 26 | #- "north-america/us/rhode-island" 27 | #- "north-america/us/texas" 28 | 29 | 30 | # Set this to yes if you are using a lot of data and/or running out of disk 31 | # space. It will create a virtual disk that will provide extra storage space 32 | # for the virtual machine. 33 | extra_storage: no 34 | 35 | # The location for the virtual disk, if used. 36 | extra_storage_file: './tmp/vm-extra-storage.vdi' 37 | 38 | # Maximum size in GB that the extra storage can be. The file will start small 39 | # and only grow as it is used. 40 | extra_storage_gb: 100 41 | --------------------------------------------------------------------------------