Merge branch 'master' into protected_area
2
.env
|
@ -6,7 +6,7 @@ POSTGRES_PORT=5432
|
||||||
QUICKSTART_MIN_ZOOM=0
|
QUICKSTART_MIN_ZOOM=0
|
||||||
QUICKSTART_MAX_ZOOM=7
|
QUICKSTART_MAX_ZOOM=7
|
||||||
DIFF_MODE=false
|
DIFF_MODE=false
|
||||||
TOOLS_VERSION=3.1.0
|
TOOLS_VERSION=4.0.0
|
||||||
|
|
||||||
BBOX=-180.0,-85.0511,180.0,85.0511
|
BBOX=-180.0,-85.0511,180.0,85.0511
|
||||||
MIN_ZOOM=0
|
MIN_ZOOM=0
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
# MapTiler OpenMapTiles
|
||||||
|
#######################
|
||||||
|
|
||||||
|
# Workflow to validate OMT`s new Pull Requests and commits pushed into OMT repo
|
||||||
|
|
||||||
|
name: OMT_CI
|
||||||
|
|
||||||
|
# Controls when the action will run. Triggers the workflow on push and pull request
|
||||||
|
# events but only for the master branch
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
# jobs can run parallel
|
||||||
|
jobs:
|
||||||
|
# This workflow contains a single job called "build"
|
||||||
|
build:
|
||||||
|
# runs on ubuntu (can run on windows and mac os)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
|
steps:
|
||||||
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Named steps
|
||||||
|
- name: generate all zooms
|
||||||
|
run: sed -i 's/QUICKSTART_MAX_ZOOM=7/QUICKSTART_MAX_ZOOM=14/g' .env
|
||||||
|
|
||||||
|
# Runs quickstart
|
||||||
|
- name: quickstart
|
||||||
|
env:
|
||||||
|
area: northamptonshire
|
||||||
|
run: bash ./quickstart.sh $area
|
||||||
|
|
||||||
|
- name: generate devdoc
|
||||||
|
run: TEST_MODE=yes make generate-devdoc
|
||||||
|
|
||||||
|
# todo: use artifact to store result of tests
|
||||||
|
#- uses: actions/upload-artifact@v1
|
||||||
|
# with:
|
||||||
|
# name: quickstart log file
|
||||||
|
# path: quickstart.log
|
|
@ -11,12 +11,12 @@ quickstart.log
|
||||||
# imput / output data
|
# imput / output data
|
||||||
data/*
|
data/*
|
||||||
|
|
||||||
# input wikidata
|
|
||||||
wikidata/*
|
|
||||||
|
|
||||||
# generated source files
|
# generated source files
|
||||||
build/*
|
build/*
|
||||||
|
|
||||||
|
# Import cache
|
||||||
|
cache/*
|
||||||
|
|
||||||
# any IDE files
|
# any IDE files
|
||||||
.idea/
|
.idea/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
11
.travis.yml
|
@ -1,11 +0,0 @@
|
||||||
sudo: required
|
|
||||||
|
|
||||||
language: bash
|
|
||||||
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
script:
|
|
||||||
- set -e
|
|
||||||
- TEST_MODE=yes make generate-devdoc
|
|
||||||
- ./quickstart.sh
|
|
|
@ -32,15 +32,11 @@ Your pull request must:
|
||||||
* Use clear commit messages.
|
* Use clear commit messages.
|
||||||
* Be possible to merge automatically.
|
* Be possible to merge automatically.
|
||||||
|
|
||||||
When you modify rules of importing data in `mapping.yaml` or `*.sql`, please update also:
|
When you modify import data rules in `mapping.yaml` or `*.sql`, please update:
|
||||||
|
|
||||||
1. field description in `[layer].yaml`
|
1. field description in `[layer].yaml`
|
||||||
2. comments starting with `#etldoc`
|
2. comments starting with `#etldoc`
|
||||||
3. if needed, generate new `mapping_diagram.png` or `etl_diagram.png` using commands below:
|
3. regenerate documentation graphs with `make generate-devdoc`
|
||||||
```
|
|
||||||
make mapping-graph-[layer]
|
|
||||||
make etl-graph-[layer]
|
|
||||||
```
|
|
||||||
4. update layer description on https://openmaptiles.org/schema/ (https://github.com/openmaptiles/www.openmaptiles.org/tree/master/layers)
|
4. update layer description on https://openmaptiles.org/schema/ (https://github.com/openmaptiles/www.openmaptiles.org/tree/master/layers)
|
||||||
5. check if OMT styles are affected by the PR and if there is a need for style updates
|
5. check if OMT styles are affected by the PR and if there is a need for style updates
|
||||||
|
|
||||||
|
|
167
Makefile
|
@ -1,15 +1,15 @@
|
||||||
# Options to run with docker and docker-compose - ensure the container is destroyed on exit
|
# Options to run with docker and docker-compose - ensure the container is destroyed on exit
|
||||||
DC_OPTS?=--rm
|
# Containers run as the current user rather than root (so that created files are not root-owned)
|
||||||
|
DC_OPTS?=--rm -u $$(id -u $${USER}):$$(id -g $${USER})
|
||||||
# container runs as the current user rather than root (so that created files are not root-owned)
|
|
||||||
DC_USER_OPTS?=$(DC_OPTS) -u $$(id -u $${USER}):$$(id -g $${USER})
|
|
||||||
|
|
||||||
# If running in the test mode, compare files rather than copy them
|
# If running in the test mode, compare files rather than copy them
|
||||||
TEST_MODE?=no
|
TEST_MODE?=no
|
||||||
ifeq ($(TEST_MODE),yes)
|
ifeq ($(TEST_MODE),yes)
|
||||||
COPY_TO_GIT=diff
|
# create images in ./build/devdoc and compare them to ./layers
|
||||||
|
GRAPH_PARAMS=./build/devdoc ./layers
|
||||||
else
|
else
|
||||||
COPY_TO_GIT=cp
|
# update graphs in the ./layers dir
|
||||||
|
GRAPH_PARAMS=./layers
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
@ -36,9 +36,7 @@ help:
|
||||||
@echo " make psql-vacuum-analyze # PostgreSQL: VACUUM ANALYZE"
|
@echo " make psql-vacuum-analyze # PostgreSQL: VACUUM ANALYZE"
|
||||||
@echo " make psql-analyze # PostgreSQL: ANALYZE"
|
@echo " make psql-analyze # PostgreSQL: ANALYZE"
|
||||||
@echo " make generate-qareports # generate reports [./build/qareports]"
|
@echo " make generate-qareports # generate reports [./build/qareports]"
|
||||||
@echo " make generate-devdoc # generate devdoc including graphs for all layers [./build/devdoc]"
|
@echo " make generate-devdoc # generate devdoc including graphs for all layers [./layers/...]"
|
||||||
@echo " make etl-graph # hint for generating a single etl graph"
|
|
||||||
@echo " make mapping-graph # hint for generating a single mapping graph"
|
|
||||||
@echo " make import-sql-dev # start import-sql /bin/bash terminal"
|
@echo " make import-sql-dev # start import-sql /bin/bash terminal"
|
||||||
@echo " make import-osm-dev # start import-osm /bin/bash terminal (imposm3)"
|
@echo " make import-osm-dev # start import-osm /bin/bash terminal (imposm3)"
|
||||||
@echo " make clean-docker # remove docker containers, PG data volume"
|
@echo " make clean-docker # remove docker containers, PG data volume"
|
||||||
|
@ -53,29 +51,30 @@ help:
|
||||||
@echo " make help # help about available commands"
|
@echo " make help # help about available commands"
|
||||||
@echo "=============================================================================="
|
@echo "=============================================================================="
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: init-dirs
|
||||||
build:
|
init-dirs:
|
||||||
mkdir -p build
|
mkdir -p build && mkdir -p data && mkdir -p cache
|
||||||
|
|
||||||
build/openmaptiles.tm2source/data.yml: build
|
build/openmaptiles.tm2source/data.yml: init-dirs
|
||||||
mkdir -p build/openmaptiles.tm2source
|
mkdir -p build/openmaptiles.tm2source
|
||||||
docker-compose run $(DC_OPTS) openmaptiles-tools generate-tm2source openmaptiles.yaml --host="postgres" --port=5432 --database="openmaptiles" --user="openmaptiles" --password="openmaptiles" > $@
|
docker-compose run $(DC_OPTS) openmaptiles-tools generate-tm2source openmaptiles.yaml --host="postgres" --port=5432 --database="openmaptiles" --user="openmaptiles" --password="openmaptiles" > $@
|
||||||
|
|
||||||
build/mapping.yaml: build
|
build/mapping.yaml: init-dirs
|
||||||
docker-compose run $(DC_OPTS) openmaptiles-tools generate-imposm3 openmaptiles.yaml > $@
|
docker-compose run $(DC_OPTS) openmaptiles-tools generate-imposm3 openmaptiles.yaml > $@
|
||||||
|
|
||||||
build/tileset.sql: build
|
build/tileset.sql: init-dirs
|
||||||
docker-compose run $(DC_OPTS) openmaptiles-tools generate-sql openmaptiles.yaml > $@
|
docker-compose run $(DC_OPTS) openmaptiles-tools generate-sql openmaptiles.yaml > $@
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -f build/openmaptiles.tm2source/data.yml && rm -f build/mapping.yaml && rm -f build/tileset.sql
|
rm -rf build
|
||||||
|
|
||||||
.PHONY: clean-docker
|
.PHONY: clean-docker
|
||||||
clean-docker:
|
clean-docker:
|
||||||
docker-compose down -v --remove-orphans
|
docker-compose down -v --remove-orphans
|
||||||
docker-compose rm -fv
|
docker-compose rm -fv
|
||||||
docker volume ls -q | grep openmaptiles | xargs -r docker volume rm || true
|
docker volume ls -q | grep openmaptiles | xargs -r docker volume rm || true
|
||||||
|
rm -rf cache
|
||||||
|
|
||||||
.PHONY: db-start
|
.PHONY: db-start
|
||||||
db-start:
|
db-start:
|
||||||
|
@ -83,13 +82,17 @@ db-start:
|
||||||
@echo "Wait for PostgreSQL to start..."
|
@echo "Wait for PostgreSQL to start..."
|
||||||
docker-compose run $(DC_OPTS) import-osm ./pgwait.sh
|
docker-compose run $(DC_OPTS) import-osm ./pgwait.sh
|
||||||
|
|
||||||
|
.PHONY: db-stop
|
||||||
|
db-stop:
|
||||||
|
docker-compose stop postgres
|
||||||
|
|
||||||
.PHONY: download-geofabrik
|
.PHONY: download-geofabrik
|
||||||
download-geofabrik:
|
download-geofabrik: init-dirs
|
||||||
@echo =============== download-geofabrik =======================
|
@echo =============== download-geofabrik =======================
|
||||||
@echo Download area : $(area)
|
@echo Download area: $(area)
|
||||||
@echo [[ example: make download-geofabrik area=albania ]]
|
@echo [[ example: make download-geofabrik area=albania ]]
|
||||||
@echo [[ list areas: make download-geofabrik-list ]]
|
@echo [[ list areas: make download-geofabrik-list ]]
|
||||||
docker-compose run $(DC_OPTS) import-osm ./download-geofabrik.sh $(area)
|
docker-compose run $(DC_OPTS) import-osm ./download-geofabrik.sh $(area)
|
||||||
ls -la ./data/$(area).*
|
ls -la ./data/$(area).*
|
||||||
@echo "Generated config file: ./data/docker-compose-config.yml"
|
@echo "Generated config file: ./data/docker-compose-config.yml"
|
||||||
@echo " "
|
@echo " "
|
||||||
|
@ -109,23 +112,37 @@ import-sql: db-start all
|
||||||
docker-compose run $(DC_OPTS) openmaptiles-tools import-sql
|
docker-compose run $(DC_OPTS) openmaptiles-tools import-sql
|
||||||
|
|
||||||
.PHONY: import-osmsql
|
.PHONY: import-osmsql
|
||||||
import-osmsql: db-start all
|
import-osmsql: db-start all import-osm import-sql
|
||||||
docker-compose run $(DC_OPTS) import-osm
|
|
||||||
docker-compose run $(DC_OPTS) openmaptiles-tools import-sql
|
.PHONY: import-borders
|
||||||
|
import-borders: db-start
|
||||||
|
docker-compose run $(DC_OPTS) openmaptiles-tools import-borders
|
||||||
|
|
||||||
|
.PHONY: import-water
|
||||||
|
import-water: db-start
|
||||||
|
docker-compose run $(DC_OPTS) import-water
|
||||||
|
|
||||||
|
.PHONY: import-natural-earth
|
||||||
|
import-natural-earth: db-start
|
||||||
|
docker-compose run $(DC_OPTS) import-natural-earth
|
||||||
|
|
||||||
|
.PHONY: import-lakelines
|
||||||
|
import-lakelines: db-start
|
||||||
|
docker-compose run $(DC_OPTS) import-lakelines
|
||||||
|
|
||||||
.PHONY: generate-tiles
|
.PHONY: generate-tiles
|
||||||
generate-tiles: db-start all
|
generate-tiles: init-dirs db-start all
|
||||||
rm -rf data/tiles.mbtiles
|
rm -rf data/tiles.mbtiles
|
||||||
if [ -f ./data/docker-compose-config.yml ]; then \
|
if [ -f ./data/docker-compose-config.yml ]; then \
|
||||||
docker-compose -f docker-compose.yml -f ./data/docker-compose-config.yml run $(DC_OPTS) generate-vectortiles; \
|
docker-compose -f docker-compose.yml -f ./data/docker-compose-config.yml \
|
||||||
|
run $(DC_OPTS) generate-vectortiles; \
|
||||||
else \
|
else \
|
||||||
docker-compose run $(DC_OPTS) generate-vectortiles; \
|
docker-compose run $(DC_OPTS) generate-vectortiles; \
|
||||||
fi
|
fi
|
||||||
docker-compose run $(DC_OPTS) openmaptiles-tools generate-metadata ./data/tiles.mbtiles
|
docker-compose run $(DC_OPTS) openmaptiles-tools generate-metadata ./data/tiles.mbtiles
|
||||||
docker-compose run $(DC_OPTS) openmaptiles-tools chmod 666 ./data/tiles.mbtiles
|
|
||||||
|
|
||||||
.PHONY: start-tileserver
|
.PHONY: start-tileserver
|
||||||
start-tileserver:
|
start-tileserver: init-dirs
|
||||||
@echo " "
|
@echo " "
|
||||||
@echo "***********************************************************"
|
@echo "***********************************************************"
|
||||||
@echo "* "
|
@echo "* "
|
||||||
|
@ -172,41 +189,13 @@ start-postserve: db-start
|
||||||
generate-qareports:
|
generate-qareports:
|
||||||
./qa/run.sh
|
./qa/run.sh
|
||||||
|
|
||||||
build/devdoc:
|
|
||||||
mkdir -p ./build/devdoc
|
|
||||||
|
|
||||||
|
|
||||||
layers = $(notdir $(wildcard layers/*)) # all layers
|
|
||||||
|
|
||||||
.PHONY: etl-graph
|
|
||||||
etl-graph:
|
|
||||||
@echo 'Use'
|
|
||||||
@echo ' make etl-graph-[layer] to generate etl graph for [layer]'
|
|
||||||
@echo ' example: make etl-graph-poi'
|
|
||||||
@echo 'Valid layers: $(layers)'
|
|
||||||
|
|
||||||
# generate etl graph for a certain layer, e.g. etl-graph-building, etl-graph-place
|
|
||||||
etl-graph-%: layers/% build/devdoc
|
|
||||||
docker-compose run $(DC_USER_OPTS) openmaptiles-tools generate-etlgraph layers/$*/$*.yaml ./build/devdoc
|
|
||||||
@$(COPY_TO_GIT) ./build/devdoc/etl_$*.png layers/$*/etl_diagram.png
|
|
||||||
|
|
||||||
|
|
||||||
mappingLayers = $(notdir $(patsubst %/mapping.yaml,%, $(wildcard layers/*/mapping.yaml))) # layers with mapping.yaml
|
|
||||||
|
|
||||||
# generate mapping graph for a certain layer, e.g. mapping-graph-building, mapping-graph-place
|
|
||||||
.PHONY: mapping-graph
|
|
||||||
mapping-graph:
|
|
||||||
@echo 'Use'
|
|
||||||
@echo ' make mapping-graph-[layer] to generate mapping graph for [layer]'
|
|
||||||
@echo ' example: make mapping-graph-poi'
|
|
||||||
@echo 'Valid layers: $(mappingLayers)'
|
|
||||||
|
|
||||||
mapping-graph-%: ./layers/%/mapping.yaml build/devdoc
|
|
||||||
docker-compose run $(DC_USER_OPTS) openmaptiles-tools generate-mapping-graph layers/$*/$*.yaml ./build/devdoc/mapping-diagram-$*
|
|
||||||
@$(COPY_TO_GIT) ./build/devdoc/mapping-diagram-$*.png layers/$*/mapping_diagram.png
|
|
||||||
|
|
||||||
# generate all etl and mapping graphs
|
# generate all etl and mapping graphs
|
||||||
generate-devdoc: $(addprefix etl-graph-,$(layers)) $(addprefix mapping-graph-,$(mappingLayers))
|
.PHONY: generate-devdoc
|
||||||
|
generate-devdoc: init-dirs
|
||||||
|
mkdir -p ./build/devdoc && \
|
||||||
|
docker-compose run $(DC_OPTS) openmaptiles-tools-latest sh -c \
|
||||||
|
'generate-etlgraph openmaptiles.yaml $(GRAPH_PARAMS) && \
|
||||||
|
generate-mapping-graph openmaptiles.yaml $(GRAPH_PARAMS)'
|
||||||
|
|
||||||
.PHONY: import-sql-dev
|
.PHONY: import-sql-dev
|
||||||
import-sql-dev:
|
import-sql-dev:
|
||||||
|
@ -218,49 +207,51 @@ import-osm-dev:
|
||||||
|
|
||||||
# the `download-geofabrik` error message mention `list`, if the area parameter is wrong. so I created a similar make command
|
# the `download-geofabrik` error message mention `list`, if the area parameter is wrong. so I created a similar make command
|
||||||
.PHONY: list
|
.PHONY: list
|
||||||
list:
|
list: download-geofabrik-list
|
||||||
docker-compose run $(DC_OPTS) import-osm ./download-geofabrik-list.sh
|
|
||||||
|
|
||||||
# same as a `make list`
|
|
||||||
.PHONY: download-geofabrik-list
|
.PHONY: download-geofabrik-list
|
||||||
download-geofabrik-list:
|
download-geofabrik-list:
|
||||||
docker-compose run $(DC_OPTS) import-osm ./download-geofabrik-list.sh
|
docker-compose run $(DC_OPTS) import-osm ./download-geofabrik-list.sh
|
||||||
|
|
||||||
.PHONY: download-wikidata
|
.PHONY: import-wikidata
|
||||||
download-wikidata:
|
import-wikidata:
|
||||||
mkdir -p wikidata && docker-compose run $(DC_OPTS) --entrypoint /usr/src/app/download-gz.sh import-wikidata
|
docker-compose run $(DC_OPTS) openmaptiles-tools import-wikidata openmaptiles.yaml
|
||||||
|
|
||||||
.PHONY: psql-list-tables
|
|
||||||
psql-list-tables:
|
|
||||||
docker-compose run $(DC_OPTS) import-osm ./psql.sh -P pager=off -c "\d+"
|
|
||||||
|
|
||||||
.PHONY: psql-pg-stat-reset
|
.PHONY: psql-pg-stat-reset
|
||||||
psql-pg-stat-reset:
|
psql-pg-stat-reset:
|
||||||
docker-compose run $(DC_OPTS) import-osm ./psql.sh -P pager=off -c 'SELECT pg_stat_statements_reset();'
|
docker-compose run $(DC_OPTS) import-osm ./psql.sh -v ON_ERROR_STOP=1 -P pager=off -c 'SELECT pg_stat_statements_reset();'
|
||||||
|
|
||||||
.PHONY: forced-clean-sql
|
.PHONY: forced-clean-sql
|
||||||
forced-clean-sql:
|
forced-clean-sql:
|
||||||
docker-compose run $(DC_OPTS) import-osm ./psql.sh -c "DROP SCHEMA IF EXISTS public CASCADE ; CREATE SCHEMA IF NOT EXISTS public; "
|
docker-compose run $(DC_OPTS) import-osm ./psql.sh -v ON_ERROR_STOP=1 \
|
||||||
docker-compose run $(DC_OPTS) import-osm ./psql.sh -c "CREATE EXTENSION hstore; CREATE EXTENSION postgis; CREATE EXTENSION unaccent; CREATE EXTENSION fuzzystrmatch; CREATE EXTENSION osml10n; CREATE EXTENSION pg_stat_statements;"
|
-c "DROP SCHEMA IF EXISTS public CASCADE; CREATE SCHEMA IF NOT EXISTS public;" \
|
||||||
docker-compose run $(DC_OPTS) import-osm ./psql.sh -c "GRANT ALL ON SCHEMA public TO public;COMMENT ON SCHEMA public IS 'standard public schema';"
|
-c "CREATE EXTENSION hstore; CREATE EXTENSION postgis; CREATE EXTENSION unaccent;" \
|
||||||
|
-c "CREATE EXTENSION fuzzystrmatch; CREATE EXTENSION osml10n; CREATE EXTENSION pg_stat_statements;" \
|
||||||
|
-c "GRANT ALL ON SCHEMA public TO public; COMMENT ON SCHEMA public IS 'standard public schema';"
|
||||||
|
|
||||||
.PHONY: pgclimb-list-views
|
.PHONY: list-views
|
||||||
pgclimb-list-views:
|
list-views:
|
||||||
docker-compose run $(DC_OPTS) import-osm ./pgclimb.sh -c "select schemaname,viewname from pg_views where schemaname='public' order by viewname;" csv
|
@docker-compose run $(DC_OPTS) import-osm ./psql.sh -v ON_ERROR_STOP=1 -A -F"," -P pager=off -P footer=off \
|
||||||
|
-c "select schemaname, viewname from pg_views where schemaname='public' order by viewname;"
|
||||||
|
|
||||||
.PHONY: pgclimb-list-tables
|
.PHONY: list-tables
|
||||||
pgclimb-list-tables:
|
list-tables:
|
||||||
docker-compose run $(DC_OPTS) import-osm ./pgclimb.sh -c "select schemaname,tablename from pg_tables where schemaname='public' order by tablename;" csv
|
@docker-compose run $(DC_OPTS) import-osm ./psql.sh -v ON_ERROR_STOP=1 -A -F"," -P pager=off -P footer=off \
|
||||||
|
-c "select schemaname, tablename from pg_tables where schemaname='public' order by tablename;"
|
||||||
|
|
||||||
|
.PHONY: psql-list-tables
|
||||||
|
psql-list-tables:
|
||||||
|
docker-compose run $(DC_OPTS) import-osm ./psql.sh -v ON_ERROR_STOP=1 -P pager=off -c "\d+"
|
||||||
|
|
||||||
.PHONY: psql-vacuum-analyze
|
.PHONY: psql-vacuum-analyze
|
||||||
psql-vacuum-analyze:
|
psql-vacuum-analyze:
|
||||||
@echo "Start - postgresql: VACUUM ANALYZE VERBOSE;"
|
@echo "Start - postgresql: VACUUM ANALYZE VERBOSE;"
|
||||||
docker-compose run $(DC_OPTS) import-osm ./psql.sh -P pager=off -c 'VACUUM ANALYZE VERBOSE;'
|
docker-compose run $(DC_OPTS) import-osm ./psql.sh -v ON_ERROR_STOP=1 -P pager=off -c 'VACUUM ANALYZE VERBOSE;'
|
||||||
|
|
||||||
.PHONY: psql-analyze
|
.PHONY: psql-analyze
|
||||||
psql-analyze:
|
psql-analyze:
|
||||||
@echo "Start - postgresql: ANALYZE VERBOSE ;"
|
@echo "Start - postgresql: ANALYZE VERBOSE;"
|
||||||
docker-compose run $(DC_OPTS) import-osm ./psql.sh -P pager=off -c 'ANALYZE VERBOSE;'
|
docker-compose run $(DC_OPTS) import-osm ./psql.sh -v ON_ERROR_STOP=1 -P pager=off -c 'ANALYZE VERBOSE;'
|
||||||
|
|
||||||
.PHONY: list-docker-images
|
.PHONY: list-docker-images
|
||||||
list-docker-images:
|
list-docker-images:
|
||||||
|
|
|
@ -411,7 +411,6 @@ the current output:
|
||||||
OpenMapTiles https://github.com/openmaptiles/openmaptiles
|
OpenMapTiles https://github.com/openmaptiles/openmaptiles
|
||||||
Hints for testing areas
|
Hints for testing areas
|
||||||
make download-geofabrik-list # list actual geofabrik OSM extracts for download -> <<your-area>>
|
make download-geofabrik-list # list actual geofabrik OSM extracts for download -> <<your-area>>
|
||||||
make list # list actual geofabrik OSM extracts for download -> <<your-area>>
|
|
||||||
./quickstart.sh <<your-area>> # example: ./quickstart.sh madagascar
|
./quickstart.sh <<your-area>> # example: ./quickstart.sh madagascar
|
||||||
|
|
||||||
Hints for designers:
|
Hints for designers:
|
||||||
|
@ -434,8 +433,8 @@ Hints for developers:
|
||||||
make docker-unnecessary-clean # clean unnecessary docker image(s) and container(s)
|
make docker-unnecessary-clean # clean unnecessary docker image(s) and container(s)
|
||||||
make refresh-docker-images # refresh openmaptiles docker images from Docker HUB
|
make refresh-docker-images # refresh openmaptiles docker images from Docker HUB
|
||||||
make remove-docker-images # remove openmaptiles docker images
|
make remove-docker-images # remove openmaptiles docker images
|
||||||
make pgclimb-list-views # list PostgreSQL public schema views
|
make list-views # list PostgreSQL public schema views
|
||||||
make pgclimb-list-tables # list PostgreSQL public schema tables
|
make list-tables # list PostgreSQL public schema tables
|
||||||
cat .env # list PG database and MIN_ZOOM and MAX_ZOOM information
|
cat .env # list PG database and MIN_ZOOM and MAX_ZOOM information
|
||||||
cat ./quickstart.log # backup of the last ./quickstart.sh
|
cat ./quickstart.log # backup of the last ./quickstart.sh
|
||||||
make help # help about available commands
|
make help # help about available commands
|
||||||
|
|
44
README.md
|
@ -1,4 +1,4 @@
|
||||||
## OpenMapTiles [](https://travis-ci.org/openmaptiles/openmaptiles)
|
## OpenMapTiles [](https://github.com/openmaptiles/openmaptiles/actions)
|
||||||
|
|
||||||
OpenMapTiles is an extensible and open tile schema based on the OpenStreetMap. This project is used to generate vector tiles for online zoomable maps. OpenMapTiles is about creating a beautiful basemaps with general layers containing topographic information. More information [openmaptiles.org](https://openmaptiles.org/) and [openmaptiles.com](https://openmaptiles.com/).
|
OpenMapTiles is an extensible and open tile schema based on the OpenStreetMap. This project is used to generate vector tiles for online zoomable maps. OpenMapTiles is about creating a beautiful basemaps with general layers containing topographic information. More information [openmaptiles.org](https://openmaptiles.org/) and [openmaptiles.com](https://openmaptiles.com/).
|
||||||
|
|
||||||
|
@ -94,26 +94,15 @@ or use the provided `quickstart.sh` script.
|
||||||
Now start up the database container.
|
Now start up the database container.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d postgres
|
make db-start
|
||||||
```
|
```
|
||||||
|
|
||||||
Import external data from [OpenStreetMapData](http://osmdata.openstreetmap.de/), [Natural Earth](http://www.naturalearthdata.com/) and [OpenStreetMap Lake Labels](https://github.com/lukasmartinelli/osm-lakelines).
|
Import external data from [OpenStreetMapData](http://osmdata.openstreetmap.de/), [Natural Earth](http://www.naturalearthdata.com/) and [OpenStreetMap Lake Labels](https://github.com/lukasmartinelli/osm-lakelines).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run import-water
|
make import-water
|
||||||
docker-compose run import-natural-earth
|
make import-natural-earth
|
||||||
docker-compose run import-lakelines
|
make import-lakelines
|
||||||
docker-compose run import-osmborder
|
|
||||||
```
|
|
||||||
|
|
||||||
**[Optional]**
|
|
||||||
Import latest Wikidata. If an OSM feature has [Key:wikidata](https://wiki.openstreetmap.org/wiki/Key:wikidata), OpenMapTiles check corresponding item in Wikidata and use its [labels](https://www.wikidata.org/wiki/Help:Label) for languages listed in [openmaptiles.yaml](openmaptiles.yaml). So the generated vector tiles includes multi-languages in name field.
|
|
||||||
|
|
||||||
Beware that current [Wikidata dump](https://dumps.wikimedia.org/wikidatawiki/entities/latest-all.json.gz) is more than 55GB, it takes time to download and import it. If you just want to have a quickstart on OpenMapTiles, just skip this step.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make download-wikidata
|
|
||||||
docker-compose run import-wikidata
|
|
||||||
```
|
```
|
||||||
|
|
||||||
[Download OpenStreetMap data extracts](http://download.geofabrik.de/) and store the PBF file in the `./data` directory.
|
[Download OpenStreetMap data extracts](http://download.geofabrik.de/) and store the PBF file in the `./data` directory.
|
||||||
|
@ -123,11 +112,26 @@ cd data
|
||||||
wget http://download.geofabrik.de/europe/albania-latest.osm.pbf
|
wget http://download.geofabrik.de/europe/albania-latest.osm.pbf
|
||||||
```
|
```
|
||||||
|
|
||||||
[Import OpenStreetMap data](https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-osm) with the mapping rules from
|
OR
|
||||||
`build/mapping.yaml` (which has been created by `make`).
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run import-osm
|
make download-geofabrik area=albania
|
||||||
|
```
|
||||||
|
|
||||||
|
[Import OpenStreetMap data](https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-osm) with the mapping rules from
|
||||||
|
`build/mapping.yaml` (which has been created by `make`). Run after any change in layers definiton. Also create borders table using extra processing with [osmborder](https://github.com/pnorman/osmborder) tool.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make import-osm
|
||||||
|
make import-borders
|
||||||
|
```
|
||||||
|
|
||||||
|
Import latest Wikidata. If an OSM feature has [Key:wikidata](https://wiki.openstreetmap.org/wiki/Key:wikidata), OpenMapTiles check corresponding item in Wikidata and use its [labels](https://www.wikidata.org/wiki/Help:Label) for languages listed in [openmaptiles.yaml](openmaptiles.yaml). So the generated vector tiles includes multi-languages in name field.
|
||||||
|
|
||||||
|
This step uses [Wikidata Query Service](https://query.wikidata.org) to download just the Wikidata IDs that already exist in the database.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make import-wikidata
|
||||||
```
|
```
|
||||||
|
|
||||||
### Work on Layers
|
### Work on Layers
|
||||||
|
@ -144,7 +148,7 @@ Now you are ready to **generate the vector tiles**. Using environment variables
|
||||||
you can limit the bounding box and zoom levels of what you want to generate (`docker-compose.yml`).
|
you can limit the bounding box and zoom levels of what you want to generate (`docker-compose.yml`).
|
||||||
|
|
||||||
```
|
```
|
||||||
docker-compose run generate-vectortiles
|
make generate-tiles
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
@ -28,8 +28,12 @@ docker-compose run import-osm-diff
|
||||||
|
|
||||||
## Generate Changed Tiles
|
## Generate Changed Tiles
|
||||||
|
|
||||||
After the import has finished **imposm3** will store a list of tiles in text format in the `diffdir`.
|
After the import has finished **imposm3** will store lists of tiles in text format in subfolders of the `diffdir`,
|
||||||
Copy the as `tiles.txt` to the import folder.
|
named for the date(s) on which the import took place (`YYYYMMDD`).
|
||||||
|
Copy and merge the files to `tiles.txt` in the import folder (`data`), either manually or with the following command, which also removes duplicate tiles so they are only generated once:
|
||||||
|
```
|
||||||
|
cd data && sort ./*/*.tiles | uniq > tiles.txt
|
||||||
|
```
|
||||||
|
|
||||||
Now run the command to read the tilelist and write the vector tiles for it to a new MBTiles.
|
Now run the command to read the tilelist and write the vector tiles for it to a new MBTiles.
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
version: "2"
|
version: "2"
|
||||||
volumes:
|
volumes:
|
||||||
pgdata:
|
pgdata:
|
||||||
cache:
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: "openmaptiles/postgis:${TOOLS_VERSION}"
|
image: "openmaptiles/postgis:${TOOLS_VERSION}"
|
||||||
|
@ -37,12 +36,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/import
|
- ./data:/import
|
||||||
- ./build:/mapping
|
- ./build:/mapping
|
||||||
- cache:/cache
|
- ./cache:/cache
|
||||||
import-osmborder:
|
|
||||||
image: "openmaptiles/import-osmborder:${TOOLS_VERSION}"
|
|
||||||
env_file: .env
|
|
||||||
networks:
|
|
||||||
- postgres_conn
|
|
||||||
import-osm-diff:
|
import-osm-diff:
|
||||||
image: "openmaptiles/import-osm:${TOOLS_VERSION}"
|
image: "openmaptiles/import-osm:${TOOLS_VERSION}"
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
@ -54,7 +48,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/import
|
- ./data:/import
|
||||||
- ./build:/mapping
|
- ./build:/mapping
|
||||||
- cache:/cache
|
- ./cache:/cache
|
||||||
update-osm:
|
update-osm:
|
||||||
image: "openmaptiles/import-osm:${TOOLS_VERSION}"
|
image: "openmaptiles/import-osm:${TOOLS_VERSION}"
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
@ -66,26 +60,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/import
|
- ./data:/import
|
||||||
- ./build:/mapping
|
- ./build:/mapping
|
||||||
- cache:/cache
|
- ./cache:/cache
|
||||||
import-sql:
|
|
||||||
# This target is obsolete, and was left for backwards compatibility
|
|
||||||
# Use openmaptiles-tools target instead
|
|
||||||
image: "openmaptiles/openmaptiles-tools:${TOOLS_VERSION}"
|
|
||||||
command: import-sql
|
|
||||||
env_file: .env
|
|
||||||
networks:
|
|
||||||
- postgres_conn
|
|
||||||
volumes:
|
|
||||||
- .:/tileset
|
|
||||||
- ./build:/sql
|
|
||||||
import-wikidata:
|
|
||||||
image: "openmaptiles/import-wikidata:${TOOLS_VERSION}"
|
|
||||||
env_file: .env
|
|
||||||
command: import-wikidata
|
|
||||||
networks:
|
|
||||||
- postgres_conn
|
|
||||||
volumes:
|
|
||||||
- ./wikidata:/import
|
|
||||||
openmaptiles-tools:
|
openmaptiles-tools:
|
||||||
image: "openmaptiles/openmaptiles-tools:${TOOLS_VERSION}"
|
image: "openmaptiles/openmaptiles-tools:${TOOLS_VERSION}"
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
@ -93,6 +68,18 @@ services:
|
||||||
- postgres_conn
|
- postgres_conn
|
||||||
volumes:
|
volumes:
|
||||||
- .:/tileset
|
- .:/tileset
|
||||||
|
- ./data:/import
|
||||||
|
- ./build:/sql
|
||||||
|
openmaptiles-tools-latest:
|
||||||
|
# This target exists for experimental tools that have not yet been published.
|
||||||
|
# Do not use this for production.
|
||||||
|
image: "openmaptiles/openmaptiles-tools:latest"
|
||||||
|
env_file: .env
|
||||||
|
networks:
|
||||||
|
- postgres_conn
|
||||||
|
volumes:
|
||||||
|
- .:/tileset
|
||||||
|
- ./data:/import
|
||||||
- ./build:/sql
|
- ./build:/sql
|
||||||
generate-changed-vectortiles:
|
generate-changed-vectortiles:
|
||||||
image: "openmaptiles/generate-vectortiles:${TOOLS_VERSION}"
|
image: "openmaptiles/generate-vectortiles:${TOOLS_VERSION}"
|
||||||
|
|
|
@ -15,12 +15,23 @@ layer:
|
||||||
[`aerodrome`](http://wiki.openstreetmap.org/wiki/Proposed_features/Aerodrome)
|
[`aerodrome`](http://wiki.openstreetmap.org/wiki/Proposed_features/Aerodrome)
|
||||||
and `aerodrome:type` tags.
|
and `aerodrome:type` tags.
|
||||||
values:
|
values:
|
||||||
- international
|
international:
|
||||||
- public
|
aerodrome: 'international'
|
||||||
- regional
|
aerodrome_type: 'international'
|
||||||
- military
|
public:
|
||||||
- private
|
aerodrome: 'public'
|
||||||
- other
|
aerodrome_type: ['%public%', 'civil']
|
||||||
|
regional:
|
||||||
|
aerodrome: 'regional'
|
||||||
|
aerodrome_type: 'regional'
|
||||||
|
military:
|
||||||
|
aerodrome: 'military'
|
||||||
|
aerodrome_type: '%military%'
|
||||||
|
military: 'airfield'
|
||||||
|
private:
|
||||||
|
aerodrome: 'private'
|
||||||
|
aerodrome_type: 'private'
|
||||||
|
other:
|
||||||
iata: 3-character code issued by the IATA.
|
iata: 3-character code issued by the IATA.
|
||||||
icao: 4-letter code issued by the ICAO.
|
icao: 4-letter code issued by the ICAO.
|
||||||
ele: Elevation (`ele`) in meters.
|
ele: Elevation (`ele`) in meters.
|
||||||
|
|
|
@ -27,27 +27,7 @@ $$
|
||||||
COALESCE(NULLIF(name_de, ''), name, name_en) AS name_de,
|
COALESCE(NULLIF(name_de, ''), name, name_en) AS name_de,
|
||||||
tags,
|
tags,
|
||||||
CASE
|
CASE
|
||||||
WHEN aerodrome = 'international'
|
%%FIELD_MAPPING: class %%
|
||||||
OR aerodrome_type = 'international'
|
|
||||||
THEN 'international'
|
|
||||||
WHEN
|
|
||||||
aerodrome = 'public'
|
|
||||||
OR aerodrome_type LIKE '%public%'
|
|
||||||
OR aerodrome_type = 'civil'
|
|
||||||
THEN 'public'
|
|
||||||
WHEN
|
|
||||||
aerodrome = 'regional'
|
|
||||||
OR aerodrome_type = 'regional'
|
|
||||||
THEN 'regional'
|
|
||||||
WHEN
|
|
||||||
aerodrome = 'military'
|
|
||||||
OR aerodrome_type LIKE '%military%'
|
|
||||||
OR military = 'airfield'
|
|
||||||
THEN 'military'
|
|
||||||
WHEN
|
|
||||||
aerodrome = 'private'
|
|
||||||
OR aerodrome_type = 'private'
|
|
||||||
THEN 'private'
|
|
||||||
ELSE 'other'
|
ELSE 'other'
|
||||||
END AS class,
|
END AS class,
|
||||||
NULLIF(iata, '') AS iata,
|
NULLIF(iata, '') AS iata,
|
||||||
|
@ -56,5 +36,6 @@ $$
|
||||||
round(substring(ele from E'^(-?\\d+)(\\D|$)')::int*3.2808399)::int AS ele_ft
|
round(substring(ele from E'^(-?\\d+)(\\D|$)')::int*3.2808399)::int AS ele_ft
|
||||||
FROM osm_aerodrome_label_point
|
FROM osm_aerodrome_label_point
|
||||||
WHERE geometry && bbox AND zoom_level >= 10;
|
WHERE geometry && bbox AND zoom_level >= 10;
|
||||||
|
$$
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -3,7 +3,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_aerodrome_label_point
|
# etldoc: imposm3 -> osm_aerodrome_label_point
|
||||||
aerodrome_label_point:
|
aerodrome_label_point:
|
||||||
type: geometry
|
type: geometry
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
|
@ -40,4 +40,6 @@ RETURNS TABLE(geometry geometry, class text, ref text) AS $$
|
||||||
FROM osm_aeroway_polygon WHERE zoom_level >= 14
|
FROM osm_aeroway_polygon WHERE zoom_level >= 14
|
||||||
) AS zoom_levels
|
) AS zoom_levels
|
||||||
WHERE geometry && bbox;
|
WHERE geometry && bbox;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL IMMUTABLE
|
||||||
|
PARALLEL SAFE;
|
||||||
|
|
|
@ -50,7 +50,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_aeroway_polygon
|
# etldoc: imposm3 -> osm_aeroway_polygon
|
||||||
aeroway_polygon:
|
aeroway_polygon:
|
||||||
type: polygon
|
type: polygon
|
||||||
fields:
|
columns:
|
||||||
- *ref
|
- *ref
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
|
@ -67,7 +67,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_aeroway_linestring
|
# etldoc: imposm3 -> osm_aeroway_linestring
|
||||||
aeroway_linestring:
|
aeroway_linestring:
|
||||||
type: linestring
|
type: linestring
|
||||||
fields:
|
columns:
|
||||||
- *ref
|
- *ref
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
|
|
|
@ -1,3 +1,114 @@
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen1 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen1
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen1 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen1 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 10) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 10
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen1_idx ON osm_border_linestring_gen1 USING gist (geometry);
|
||||||
|
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen2 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen2
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen2 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen2 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 20) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 10
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen2_idx ON osm_border_linestring_gen2 USING gist (geometry);
|
||||||
|
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen3 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen3
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen3 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen3 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 40) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 8
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen3_idx ON osm_border_linestring_gen3 USING gist (geometry);
|
||||||
|
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen4 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen4
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen4 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen4 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 80) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 6
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen4_idx ON osm_border_linestring_gen4 USING gist (geometry);
|
||||||
|
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen5 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen5
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen5 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen5 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 160) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 6
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen5_idx ON osm_border_linestring_gen5 USING gist (geometry);
|
||||||
|
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen6 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen6
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen6 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen6 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 300) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 4
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen6_idx ON osm_border_linestring_gen6 USING gist (geometry);
|
||||||
|
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen7 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen7
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen7 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen7 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 600) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 4
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen7_idx ON osm_border_linestring_gen7 USING gist (geometry);
|
||||||
|
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen8 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen8
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen8 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen8 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 1200) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 4
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen8_idx ON osm_border_linestring_gen8 USING gist (geometry);
|
||||||
|
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen9 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen9
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen9 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen9 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 2400) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 4
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen9_idx ON osm_border_linestring_gen9 USING gist (geometry);
|
||||||
|
|
||||||
|
-- This statement can be deleted after the border importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_border_linestring_gen10 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_border_linestring -> osm_border_linestring_gen10
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_border_linestring_gen10 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_border_linestring_gen10 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 4800) AS geometry, osm_id, admin_level, dividing_line, disputed, maritime
|
||||||
|
FROM osm_border_linestring
|
||||||
|
WHERE admin_level <= 2
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen10_idx ON osm_border_linestring_gen10 USING gist (geometry);
|
||||||
|
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION edit_name(name VARCHAR) RETURNS TEXT AS $$
|
CREATE OR REPLACE FUNCTION edit_name(name VARCHAR) RETURNS TEXT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN POSITION(' at ' in name) > 0
|
WHEN POSITION(' at ' in name) > 0
|
||||||
|
@ -359,4 +470,6 @@ RETURNS TABLE(geometry geometry, admin_level int, disputed int, disputed_name te
|
||||||
-- etldoc: boundary_z13 -> layer_boundary:z13
|
-- etldoc: boundary_z13 -> layer_boundary:z13
|
||||||
SELECT * FROM boundary_z13 WHERE geometry && bbox AND zoom_level >= 13
|
SELECT * FROM boundary_z13 WHERE geometry && bbox AND zoom_level >= 13
|
||||||
) AS zoom_levels;
|
) AS zoom_levels;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL IMMUTABLE
|
||||||
|
PARALLEL SAFE;
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 457 KiB Po Szerokość: | Wysokość: | Rozmiar: 500 KiB |
|
@ -76,7 +76,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_border_disp_relation
|
# etldoc: imposm3 -> osm_border_disp_relation
|
||||||
border_disp_relation:
|
border_disp_relation:
|
||||||
type: relation_member
|
type: relation_member
|
||||||
fields:
|
columns:
|
||||||
- name: relation_id
|
- name: relation_id
|
||||||
type: id
|
type: id
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
|
|
|
@ -60,8 +60,8 @@ CREATE OR REPLACE VIEW osm_all_buildings AS (
|
||||||
osm_building_street WHERE role = 'house' AND ST_GeometryType(geometry) = 'ST_Polygon'
|
osm_building_street WHERE role = 'house' AND ST_GeometryType(geometry) = 'ST_Polygon'
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
-- etldoc: osm_building_multipolygon -> layer_building:z14_
|
-- etldoc: osm_building_polygon -> layer_building:z14_
|
||||||
-- Buildings that are inner/outer
|
-- Buildings that are from multipolygons
|
||||||
SELECT osm_id,geometry,
|
SELECT osm_id,geometry,
|
||||||
COALESCE(nullif(as_numeric(height),-1),nullif(as_numeric(buildingheight),-1)) as height,
|
COALESCE(nullif(as_numeric(height),-1),nullif(as_numeric(buildingheight),-1)) as height,
|
||||||
COALESCE(nullif(as_numeric(min_height),-1),nullif(as_numeric(buildingmin_height),-1)) as min_height,
|
COALESCE(nullif(as_numeric(min_height),-1),nullif(as_numeric(buildingmin_height),-1)) as min_height,
|
||||||
|
@ -71,7 +71,9 @@ CREATE OR REPLACE VIEW osm_all_buildings AS (
|
||||||
nullif(colour, '') AS colour,
|
nullif(colour, '') AS colour,
|
||||||
FALSE as hide_3d
|
FALSE as hide_3d
|
||||||
FROM
|
FROM
|
||||||
osm_building_polygon obp WHERE EXISTS (SELECT 1 FROM osm_building_multipolygon obm WHERE obp.osm_id = obm.osm_id)
|
osm_building_polygon obp
|
||||||
|
WHERE osm_id < 0
|
||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_building_polygon -> layer_building:z14_
|
-- etldoc: osm_building_polygon -> layer_building:z14_
|
||||||
-- Standalone buildings
|
-- Standalone buildings
|
||||||
|
@ -112,7 +114,7 @@ RETURNS TABLE(geometry geometry, osm_id bigint, render_height int, render_min_he
|
||||||
WHEN 'sandstone' THEN '#b4a995' -- same as stone
|
WHEN 'sandstone' THEN '#b4a995' -- same as stone
|
||||||
WHEN 'clay' THEN '#9d8b75' -- same as mud
|
WHEN 'clay' THEN '#9d8b75' -- same as mud
|
||||||
END) AS colour,
|
END) AS colour,
|
||||||
CASE WHEN hide_3d THEN TRUE ELSE NULL::boolean END AS hide_3d
|
CASE WHEN hide_3d THEN TRUE END AS hide_3d
|
||||||
FROM (
|
FROM (
|
||||||
-- etldoc: osm_building_polygon_gen1 -> layer_building:z13
|
-- etldoc: osm_building_polygon_gen1 -> layer_building:z13
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -140,6 +142,8 @@ RETURNS TABLE(geometry geometry, osm_id bigint, render_height int, render_min_he
|
||||||
zoom_level >= 14 AND geometry && bbox
|
zoom_level >= 14 AND geometry && bbox
|
||||||
) AS zoom_levels
|
) AS zoom_levels
|
||||||
ORDER BY render_height ASC, ST_YMin(geometry) DESC;
|
ORDER BY render_height ASC, ST_YMin(geometry) DESC;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL IMMUTABLE
|
||||||
|
PARALLEL SAFE;
|
||||||
|
|
||||||
-- not handled: where a building outline covers building parts
|
-- not handled: where a building outline covers building parts
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 73 KiB Po Szerokość: | Wysokość: | Rozmiar: 59 KiB |
|
@ -8,7 +8,7 @@ generalized_tables:
|
||||||
tables:
|
tables:
|
||||||
# etldoc: imposm3 -> osm_building_polygon
|
# etldoc: imposm3 -> osm_building_polygon
|
||||||
building_polygon:
|
building_polygon:
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -69,7 +69,7 @@ tables:
|
||||||
|
|
||||||
# etldoc: imposm3 -> osm_building_street
|
# etldoc: imposm3 -> osm_building_street
|
||||||
building_street:
|
building_street:
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -161,7 +161,7 @@ tables:
|
||||||
|
|
||||||
# etldoc: imposm3 -> osm_building_associatedstreet
|
# etldoc: imposm3 -> osm_building_associatedstreet
|
||||||
building_associatedstreet:
|
building_associatedstreet:
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -253,7 +253,7 @@ tables:
|
||||||
|
|
||||||
# etldoc: imposm3 -> osm_building_relation
|
# etldoc: imposm3 -> osm_building_relation
|
||||||
building_relation:
|
building_relation:
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -342,76 +342,3 @@ tables:
|
||||||
mapping:
|
mapping:
|
||||||
type: [building]
|
type: [building]
|
||||||
type: relation_member
|
type: relation_member
|
||||||
|
|
||||||
# etldoc: imposm3 -> osm_building_multipolygon
|
|
||||||
building_multipolygon:
|
|
||||||
fields:
|
|
||||||
- name: osm_id
|
|
||||||
type: id
|
|
||||||
- name: geometry
|
|
||||||
type: validated_geometry
|
|
||||||
- name: area
|
|
||||||
type: area
|
|
||||||
- name: building
|
|
||||||
key: building
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: material
|
|
||||||
key: building:material
|
|
||||||
type: string
|
|
||||||
- name: colour
|
|
||||||
key: building:colour
|
|
||||||
type: string
|
|
||||||
- name: buildingpart
|
|
||||||
key: building:part
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: buildingheight
|
|
||||||
key: building:height
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: height
|
|
||||||
key: height
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: buildingmin_height
|
|
||||||
key: building:min_height
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: min_height
|
|
||||||
key: min_height
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: buildinglevels
|
|
||||||
key: building:levels
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: levels
|
|
||||||
key: levels
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: buildingmin_level
|
|
||||||
key: building:min_level
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: min_level
|
|
||||||
key: min_level
|
|
||||||
type: string
|
|
||||||
from_member: true
|
|
||||||
- name: member
|
|
||||||
type: member_id
|
|
||||||
- name: index
|
|
||||||
type: member_index
|
|
||||||
- name: role
|
|
||||||
type: member_role
|
|
||||||
from_member: true
|
|
||||||
- name: type
|
|
||||||
type: member_type
|
|
||||||
mapping:
|
|
||||||
type: [multipolygon]
|
|
||||||
filters:
|
|
||||||
reject:
|
|
||||||
building: ["no","none","No"]
|
|
||||||
building:part: ["no","none","No"]
|
|
||||||
man_made: ["bridge"]
|
|
||||||
type: relation_member
|
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 42 KiB Po Szerokość: | Wysokość: | Rozmiar: 34 KiB |
|
@ -7,4 +7,6 @@ RETURNS TABLE(osm_id bigint, geometry geometry, housenumber text) AS $$
|
||||||
-- etldoc: osm_housenumber_point -> layer_housenumber:z14_
|
-- etldoc: osm_housenumber_point -> layer_housenumber:z14_
|
||||||
SELECT osm_id, geometry, housenumber FROM osm_housenumber_point
|
SELECT osm_id, geometry, housenumber FROM osm_housenumber_point
|
||||||
WHERE zoom_level >= 14 AND geometry && bbox;
|
WHERE zoom_level >= 14 AND geometry && bbox;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -4,7 +4,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_housenumber_point
|
# etldoc: imposm3 -> osm_housenumber_point
|
||||||
housenumber_point:
|
housenumber_point:
|
||||||
type: geometry
|
type: geometry
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
|
@ -11,18 +11,11 @@
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION landcover_class(subclass VARCHAR) RETURNS TEXT AS $$
|
CREATE OR REPLACE FUNCTION landcover_class(subclass VARCHAR) RETURNS TEXT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN subclass IN ('farmland', 'farm', 'orchard', 'vineyard', 'plant_nursery') THEN 'farmland'
|
%%FIELD_MAPPING: class %%
|
||||||
WHEN subclass IN ('glacier', 'ice_shelf') THEN 'ice'
|
|
||||||
WHEN subclass IN ('wood', 'forest') THEN 'wood'
|
|
||||||
WHEN subclass IN ('bare_rock', 'scree') THEN 'rock'
|
|
||||||
WHEN subclass IN ('fell', 'grassland', 'heath', 'scrub', 'tundra', 'grass', 'meadow', 'allotments',
|
|
||||||
'park', 'village_green', 'recreation_ground', 'garden', 'golf_course') THEN 'grass'
|
|
||||||
WHEN subclass IN ('wetland', 'bog', 'swamp', 'wet_meadow', 'marsh', 'reedbed',
|
|
||||||
'saltern', 'tidalflat', 'saltmarsh', 'mangrove') THEN 'wetland'
|
|
||||||
WHEN subclass IN ('beach', 'sand', 'dune') THEN 'sand'
|
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
||||||
-- etldoc: ne_110m_glaciated_areas -> landcover_z0
|
-- etldoc: ne_110m_glaciated_areas -> landcover_z0
|
||||||
CREATE OR REPLACE VIEW landcover_z0 AS (
|
CREATE OR REPLACE VIEW landcover_z0 AS (
|
||||||
|
@ -137,4 +130,6 @@ RETURNS TABLE(osm_id bigint, geometry geometry, class text, subclass text) AS $$
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM landcover_z14 WHERE zoom_level >= 14 AND geometry && bbox
|
FROM landcover_z14 WHERE zoom_level >= 14 AND geometry && bbox
|
||||||
) AS zoom_levels;
|
) AS zoom_levels;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -10,12 +10,20 @@ layer:
|
||||||
description: |
|
description: |
|
||||||
Use the **class** to assign natural colors for **landcover**.
|
Use the **class** to assign natural colors for **landcover**.
|
||||||
values:
|
values:
|
||||||
- farmland
|
farmland:
|
||||||
- ice
|
subclass: ['farmland', 'farm', 'orchard', 'vineyard', 'plant_nursery']
|
||||||
- wood
|
ice:
|
||||||
- grass
|
subclass: ['glacier', 'ice_shelf']
|
||||||
- wetland
|
wood:
|
||||||
- sand
|
subclass: ['wood', 'forest']
|
||||||
|
rock:
|
||||||
|
subclass: ['bare_rock', 'scree']
|
||||||
|
grass:
|
||||||
|
subclass: ['fell', 'grassland', 'heath', 'scrub', 'tundra', 'grass', 'meadow', 'allotments', 'park', 'village_green', 'recreation_ground', 'garden', 'golf_course']
|
||||||
|
wetland:
|
||||||
|
subclass: ['wetland', 'bog', 'swamp', 'wet_meadow', 'marsh', 'reedbed', 'saltern', 'tidalflat', 'saltmarsh', 'mangrove']
|
||||||
|
sand:
|
||||||
|
subclass: ['beach', 'sand', 'dune']
|
||||||
subclass:
|
subclass:
|
||||||
description: |
|
description: |
|
||||||
Use **subclass** to do more precise styling.
|
Use **subclass** to do more precise styling.
|
||||||
|
|
|
@ -46,7 +46,7 @@ generalized_tables:
|
||||||
tables:
|
tables:
|
||||||
# etldoc: imposm3 -> osm_landcover_polygon
|
# etldoc: imposm3 -> osm_landcover_polygon
|
||||||
landcover_polygon:
|
landcover_polygon:
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
|
@ -1,61 +1,61 @@
|
||||||
-- etldoc: ne_50m_urban_areas -> landuse_z4
|
-- etldoc: ne_50m_urban_areas -> landuse_z4
|
||||||
CREATE OR REPLACE VIEW landuse_z4 AS (
|
CREATE OR REPLACE VIEW landuse_z4 AS (
|
||||||
SELECT NULL::bigint AS osm_id, geometry, 'residential'::text AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS tourism, NULL::text AS place, NULL::text AS waterway, scalerank
|
SELECT NULL::bigint AS osm_id, geometry, 'residential'::text AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS tourism, NULL::text AS place, NULL::text AS waterway
|
||||||
FROM ne_50m_urban_areas
|
FROM ne_50m_urban_areas
|
||||||
WHERE scalerank <= 2
|
WHERE scalerank <= 2
|
||||||
);
|
);
|
||||||
|
|
||||||
-- etldoc: ne_50m_urban_areas -> landuse_z5
|
-- etldoc: ne_50m_urban_areas -> landuse_z5
|
||||||
CREATE OR REPLACE VIEW landuse_z5 AS (
|
CREATE OR REPLACE VIEW landuse_z5 AS (
|
||||||
SELECT NULL::bigint AS osm_id, geometry, 'residential'::text AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS tourism, NULL::text AS place, NULL::text AS waterway, scalerank
|
SELECT NULL::bigint AS osm_id, geometry, 'residential'::text AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS tourism, NULL::text AS place, NULL::text AS waterway
|
||||||
FROM ne_50m_urban_areas
|
FROM ne_50m_urban_areas
|
||||||
);
|
);
|
||||||
|
|
||||||
-- etldoc: osm_landuse_polygon_gen7 -> landuse_z6
|
-- etldoc: osm_landuse_polygon_gen7 -> landuse_z6
|
||||||
CREATE OR REPLACE VIEW landuse_z6 AS (
|
CREATE OR REPLACE VIEW landuse_z6 AS (
|
||||||
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank
|
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway
|
||||||
FROM osm_landuse_polygon_gen7
|
FROM osm_landuse_polygon_gen7
|
||||||
);
|
);
|
||||||
|
|
||||||
-- etldoc: osm_landuse_polygon_gen6 -> landuse_z8
|
-- etldoc: osm_landuse_polygon_gen6 -> landuse_z8
|
||||||
CREATE OR REPLACE VIEW landuse_z8 AS (
|
CREATE OR REPLACE VIEW landuse_z8 AS (
|
||||||
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank
|
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway
|
||||||
FROM osm_landuse_polygon_gen6
|
FROM osm_landuse_polygon_gen6
|
||||||
);
|
);
|
||||||
|
|
||||||
-- etldoc: osm_landuse_polygon_gen5 -> landuse_z9
|
-- etldoc: osm_landuse_polygon_gen5 -> landuse_z9
|
||||||
CREATE OR REPLACE VIEW landuse_z9 AS (
|
CREATE OR REPLACE VIEW landuse_z9 AS (
|
||||||
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank
|
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway
|
||||||
FROM osm_landuse_polygon_gen5
|
FROM osm_landuse_polygon_gen5
|
||||||
);
|
);
|
||||||
|
|
||||||
-- etldoc: osm_landuse_polygon_gen4 -> landuse_z10
|
-- etldoc: osm_landuse_polygon_gen4 -> landuse_z10
|
||||||
CREATE OR REPLACE VIEW landuse_z10 AS (
|
CREATE OR REPLACE VIEW landuse_z10 AS (
|
||||||
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank
|
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway
|
||||||
FROM osm_landuse_polygon_gen4
|
FROM osm_landuse_polygon_gen4
|
||||||
);
|
);
|
||||||
|
|
||||||
-- etldoc: osm_landuse_polygon_gen3 -> landuse_z11
|
-- etldoc: osm_landuse_polygon_gen3 -> landuse_z11
|
||||||
CREATE OR REPLACE VIEW landuse_z11 AS (
|
CREATE OR REPLACE VIEW landuse_z11 AS (
|
||||||
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank
|
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway
|
||||||
FROM osm_landuse_polygon_gen3
|
FROM osm_landuse_polygon_gen3
|
||||||
);
|
);
|
||||||
|
|
||||||
-- etldoc: osm_landuse_polygon_gen2 -> landuse_z12
|
-- etldoc: osm_landuse_polygon_gen2 -> landuse_z12
|
||||||
CREATE OR REPLACE VIEW landuse_z12 AS (
|
CREATE OR REPLACE VIEW landuse_z12 AS (
|
||||||
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank
|
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway
|
||||||
FROM osm_landuse_polygon_gen2
|
FROM osm_landuse_polygon_gen2
|
||||||
);
|
);
|
||||||
|
|
||||||
-- etldoc: osm_landuse_polygon_gen1 -> landuse_z13
|
-- etldoc: osm_landuse_polygon_gen1 -> landuse_z13
|
||||||
CREATE OR REPLACE VIEW landuse_z13 AS (
|
CREATE OR REPLACE VIEW landuse_z13 AS (
|
||||||
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank
|
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway
|
||||||
FROM osm_landuse_polygon_gen1
|
FROM osm_landuse_polygon_gen1
|
||||||
);
|
);
|
||||||
|
|
||||||
-- etldoc: osm_landuse_polygon -> landuse_z14
|
-- etldoc: osm_landuse_polygon -> landuse_z14
|
||||||
CREATE OR REPLACE VIEW landuse_z14 AS (
|
CREATE OR REPLACE VIEW landuse_z14 AS (
|
||||||
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank
|
SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway
|
||||||
FROM osm_landuse_polygon
|
FROM osm_landuse_polygon
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -108,4 +108,6 @@ RETURNS TABLE(osm_id bigint, geometry geometry, class text) AS $$
|
||||||
SELECT * FROM landuse_z14 WHERE zoom_level >= 14
|
SELECT * FROM landuse_z14 WHERE zoom_level >= 14
|
||||||
) AS zoom_levels
|
) AS zoom_levels
|
||||||
WHERE geometry && bbox;
|
WHERE geometry && bbox;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -38,7 +38,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_landuse_polygon
|
# etldoc: imposm3 -> osm_landuse_polygon
|
||||||
landuse_polygon:
|
landuse_polygon:
|
||||||
type: polygon
|
type: polygon
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
|
@ -3,32 +3,32 @@
|
||||||
-- etldoc: style="rounded,filled", label="layer_mountain_peak | <z7_> z7+" ] ;
|
-- etldoc: style="rounded,filled", label="layer_mountain_peak | <z7_> z7+" ] ;
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION layer_mountain_peak(
|
CREATE OR REPLACE FUNCTION layer_mountain_peak(
|
||||||
bbox geometry,
|
bbox geometry,
|
||||||
zoom_level integer,
|
zoom_level integer,
|
||||||
pixel_width numeric)
|
pixel_width numeric)
|
||||||
RETURNS TABLE(
|
RETURNS TABLE(
|
||||||
osm_id bigint,
|
osm_id bigint,
|
||||||
geometry geometry,
|
geometry geometry,
|
||||||
name text,
|
name text,
|
||||||
name_en text,
|
name_en text,
|
||||||
name_de text,
|
name_de text,
|
||||||
class text,
|
class text,
|
||||||
tags hstore,
|
tags hstore,
|
||||||
ele int,
|
ele int,
|
||||||
ele_ft int,
|
ele_ft int,
|
||||||
"rank" int) AS
|
"rank" int) AS
|
||||||
$$
|
$$
|
||||||
-- etldoc: osm_peak_point -> layer_mountain_peak:z7_
|
-- etldoc: osm_peak_point -> layer_mountain_peak:z7_
|
||||||
SELECT
|
SELECT
|
||||||
osm_id,
|
osm_id,
|
||||||
geometry,
|
geometry,
|
||||||
name,
|
name,
|
||||||
name_en,
|
name_en,
|
||||||
name_de,
|
name_de,
|
||||||
tags -> 'natural' AS class,
|
tags -> 'natural' AS class,
|
||||||
tags,
|
tags,
|
||||||
ele::int,
|
ele::int,
|
||||||
ele_ft::int,
|
ele_ft::int,
|
||||||
rank::int FROM (
|
rank::int FROM (
|
||||||
SELECT osm_id, geometry, name,
|
SELECT osm_id, geometry, name,
|
||||||
COALESCE(NULLIF(name_en, ''), name) AS name_en,
|
COALESCE(NULLIF(name_en, ''), name) AS name_en,
|
||||||
|
@ -52,4 +52,6 @@ $$
|
||||||
WHERE zoom_level >= 7 AND (rank <= 5 OR zoom_level >= 14)
|
WHERE zoom_level >= 7 AND (rank <= 5 OR zoom_level >= 14)
|
||||||
ORDER BY "rank" ASC;
|
ORDER BY "rank" ASC;
|
||||||
|
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -3,7 +3,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_peak_point
|
# etldoc: imposm3 -> osm_peak_point
|
||||||
peak_point:
|
peak_point:
|
||||||
type: point
|
type: point
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 153 KiB Po Szerokość: | Wysokość: | Rozmiar: 138 KiB |
|
@ -15,37 +15,37 @@ RETURNS TABLE(osm_id bigint, geometry geometry, class text, name text, name_en t
|
||||||
NULL::int as rank
|
NULL::int as rank
|
||||||
FROM (
|
FROM (
|
||||||
-- etldoc: osm_park_polygon_gen8 -> layer_park:z6
|
-- etldoc: osm_park_polygon_gen8 -> layer_park:z6
|
||||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title, NULL::int as scalerank
|
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||||
FROM osm_park_polygon_gen8
|
FROM osm_park_polygon_gen8
|
||||||
WHERE zoom_level = 6 AND geometry && bbox
|
WHERE zoom_level = 6 AND geometry && bbox
|
||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_park_polygon_gen7 -> layer_park:z7
|
-- etldoc: osm_park_polygon_gen7 -> layer_park:z7
|
||||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title, NULL::int as scalerank
|
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||||
FROM osm_park_polygon_gen7
|
FROM osm_park_polygon_gen7
|
||||||
WHERE zoom_level = 7 AND geometry && bbox
|
WHERE zoom_level = 7 AND geometry && bbox
|
||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_park_polygon_gen6 -> layer_park:z8
|
-- etldoc: osm_park_polygon_gen6 -> layer_park:z8
|
||||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title, NULL::int as scalerank
|
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||||
FROM osm_park_polygon_gen6
|
FROM osm_park_polygon_gen6
|
||||||
WHERE zoom_level = 8 AND geometry && bbox
|
WHERE zoom_level = 8 AND geometry && bbox
|
||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_park_polygon_gen5 -> layer_park:z9
|
-- etldoc: osm_park_polygon_gen5 -> layer_park:z9
|
||||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title, NULL::int as scalerank
|
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||||
FROM osm_park_polygon_gen5
|
FROM osm_park_polygon_gen5
|
||||||
WHERE zoom_level = 9 AND geometry && bbox
|
WHERE zoom_level = 9 AND geometry && bbox
|
||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_park_polygon_gen4 -> layer_park:z10
|
-- etldoc: osm_park_polygon_gen4 -> layer_park:z10
|
||||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title, NULL::int as scalerank
|
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||||
FROM osm_park_polygon_gen4
|
FROM osm_park_polygon_gen4
|
||||||
WHERE zoom_level = 10 AND geometry && bbox
|
WHERE zoom_level = 10 AND geometry && bbox
|
||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_park_polygon_gen3 -> layer_park:z11
|
-- etldoc: osm_park_polygon_gen3 -> layer_park:z11
|
||||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title, NULL::int as scalerank
|
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||||
FROM osm_park_polygon_gen3
|
FROM osm_park_polygon_gen3
|
||||||
WHERE zoom_level = 11 AND geometry && bbox
|
WHERE zoom_level = 11 AND geometry && bbox
|
||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_park_polygon_gen2 -> layer_park:z12
|
-- etldoc: osm_park_polygon_gen2 -> layer_park:z12
|
||||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title, NULL::int as scalerank
|
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||||
FROM osm_park_polygon_gen2
|
FROM osm_park_polygon_gen2
|
||||||
WHERE zoom_level = 12 AND geometry && bbox
|
WHERE zoom_level = 12 AND geometry && bbox
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
@ -130,4 +130,6 @@ RETURNS TABLE(osm_id bigint, geometry geometry, class text, name text, name_en t
|
||||||
WHERE zoom_level >= 14 AND geometry_point && bbox
|
WHERE zoom_level >= 14 AND geometry_point && bbox
|
||||||
) AS park_point
|
) AS park_point
|
||||||
) AS park_all;
|
) AS park_all;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -52,7 +52,8 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_park_polygon
|
# etldoc: imposm3 -> osm_park_polygon
|
||||||
park_polygon:
|
park_polygon:
|
||||||
type: polygon
|
type: polygon
|
||||||
fields:
|
_resolve_wikidata: false
|
||||||
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
|
@ -3,6 +3,7 @@ RETURNS INT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN capital IN ('yes', '2') THEN 2
|
WHEN capital IN ('yes', '2') THEN 2
|
||||||
WHEN capital = '4' THEN 4
|
WHEN capital = '4' THEN 4
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE STRICT PARALLEL SAFE;
|
||||||
|
|
|
@ -52,4 +52,6 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, name_de
|
||||||
OR (zoom_level BETWEEN 11 AND 12 AND (gridrank <= 14 OR "rank" IS NOT NULL))
|
OR (zoom_level BETWEEN 11 AND 12 AND (gridrank <= 14 OR "rank" IS NOT NULL))
|
||||||
OR (zoom_level >= 13)
|
OR (zoom_level >= 13)
|
||||||
) as city_all;
|
) as city_all;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 141 KiB Po Szerokość: | Wysokość: | Rozmiar: 137 KiB |
|
@ -6,4 +6,6 @@ CREATE OR REPLACE FUNCTION island_rank(area REAL) RETURNS INT AS $$
|
||||||
WHEN area > 40000000 THEN 3
|
WHEN area > 40000000 THEN 3
|
||||||
ELSE 7
|
ELSE 7
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE STRICT PARALLEL SAFE;
|
||||||
|
|
|
@ -96,4 +96,6 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
|
||||||
FROM layer_city(bbox, zoom_level, pixel_width)
|
FROM layer_city(bbox, zoom_level, pixel_width)
|
||||||
ORDER BY "rank" ASC
|
ORDER BY "rank" ASC
|
||||||
) AS place_all
|
) AS place_all
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -20,7 +20,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_continent_point
|
# etldoc: imposm3 -> osm_continent_point
|
||||||
continent_point:
|
continent_point:
|
||||||
type: point
|
type: point
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -40,7 +40,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_country_point
|
# etldoc: imposm3 -> osm_country_point
|
||||||
country_point:
|
country_point:
|
||||||
type: point
|
type: point
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -70,7 +70,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_island_polygon
|
# etldoc: imposm3 -> osm_island_polygon
|
||||||
island_polygon:
|
island_polygon:
|
||||||
type: polygon
|
type: polygon
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -93,7 +93,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_island_point
|
# etldoc: imposm3 -> osm_island_point
|
||||||
island_point:
|
island_point:
|
||||||
type: point
|
type: point
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -114,7 +114,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_state_point
|
# etldoc: imposm3 -> osm_state_point
|
||||||
state_point:
|
state_point:
|
||||||
type: point
|
type: point
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -144,7 +144,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_city_point
|
# etldoc: imposm3 -> osm_city_point
|
||||||
city_point:
|
city_point:
|
||||||
type: point
|
type: point
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
|
@ -25,44 +25,16 @@ RETURNS INT AS $$
|
||||||
WHEN 'bar' THEN 800
|
WHEN 'bar' THEN 800
|
||||||
ELSE 1000
|
ELSE 1000
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION poi_class(subclass TEXT, mapping_key TEXT)
|
CREATE OR REPLACE FUNCTION poi_class(subclass TEXT, mapping_key TEXT)
|
||||||
RETURNS TEXT AS $$
|
RETURNS TEXT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN subclass IN ('accessories','antiques','beauty','bed','boutique','camera','carpet','charity','chemist','coffee','computer','convenience','copyshop','cosmetics','garden_centre','doityourself','erotic','electronics','fabric','florist','frozen_food','furniture','video_games','video','general','gift','hardware','hearing_aids','hifi','ice_cream','interior_decoration','jewelry','kiosk','lamps','mall','massage','motorcycle','mobile_phone','newsagent','optician','outdoor','perfumery','perfume','pet','photo','second_hand','shoes','sports','stationery','tailor','tattoo','ticket','tobacco','toys','travel_agency','watches','weapons','wholesale') THEN 'shop'
|
%%FIELD_MAPPING: class %%
|
||||||
WHEN subclass IN ('townhall','public_building','courthouse','community_centre') THEN 'town_hall'
|
|
||||||
WHEN subclass IN ('golf','golf_course','miniature_golf') THEN 'golf'
|
|
||||||
WHEN subclass IN ('fast_food','food_court') THEN 'fast_food'
|
|
||||||
WHEN subclass IN ('park','bbq') THEN 'park'
|
|
||||||
WHEN subclass IN ('bus_stop','bus_station') THEN 'bus'
|
|
||||||
WHEN (subclass='station' AND mapping_key = 'railway') OR subclass IN ('halt', 'tram_stop', 'subway') THEN 'railway'
|
|
||||||
WHEN (subclass='station' AND mapping_key = 'aerialway') THEN 'aerialway'
|
|
||||||
WHEN subclass IN ('subway_entrance','train_station_entrance') THEN 'entrance'
|
|
||||||
WHEN subclass IN ('camp_site','caravan_site') THEN 'campsite'
|
|
||||||
WHEN subclass IN ('laundry','dry_cleaning') THEN 'laundry'
|
|
||||||
WHEN subclass IN ('supermarket','deli','delicatessen','department_store','greengrocer','marketplace') THEN 'grocery'
|
|
||||||
WHEN subclass IN ('books','library') THEN 'library'
|
|
||||||
WHEN subclass IN ('university','college') THEN 'college'
|
|
||||||
WHEN subclass IN ('hotel','motel','bed_and_breakfast','guest_house','hostel','chalet','alpine_hut','dormitory') THEN 'lodging'
|
|
||||||
WHEN subclass IN ('chocolate','confectionery') THEN 'ice_cream'
|
|
||||||
WHEN subclass IN ('post_box','post_office') THEN 'post'
|
|
||||||
WHEN subclass IN ('cafe') THEN 'cafe'
|
|
||||||
WHEN subclass IN ('school','kindergarten') THEN 'school'
|
|
||||||
WHEN subclass IN ('alcohol','beverages','wine') THEN 'alcohol_shop'
|
|
||||||
WHEN subclass IN ('bar','nightclub') THEN 'bar'
|
|
||||||
WHEN subclass IN ('marina','dock') THEN 'harbor'
|
|
||||||
WHEN subclass IN ('car','car_repair','taxi') THEN 'car'
|
|
||||||
WHEN subclass IN ('hospital','nursing_home', 'clinic') THEN 'hospital'
|
|
||||||
WHEN subclass IN ('grave_yard','cemetery') THEN 'cemetery'
|
|
||||||
WHEN subclass IN ('attraction','viewpoint') THEN 'attraction'
|
|
||||||
WHEN subclass IN ('biergarten','pub') THEN 'beer'
|
|
||||||
WHEN subclass IN ('music','musical_instrument') THEN 'music'
|
|
||||||
WHEN subclass IN ('american_football','stadium','soccer') THEN 'stadium'
|
|
||||||
WHEN subclass IN ('art','artwork','gallery','arts_centre') THEN 'art_gallery'
|
|
||||||
WHEN subclass IN ('bag','clothes') THEN 'clothing_store'
|
|
||||||
WHEN subclass IN ('swimming_area','swimming') THEN 'swimming'
|
|
||||||
WHEN subclass IN ('castle','ruins') THEN 'castle'
|
|
||||||
ELSE subclass
|
ELSE subclass
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -21,7 +21,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, name_de
|
||||||
agg_stop,
|
agg_stop,
|
||||||
NULLIF(layer, 0) AS layer,
|
NULLIF(layer, 0) AS layer,
|
||||||
"level",
|
"level",
|
||||||
CASE WHEN indoor=TRUE THEN 1 ELSE NULL END as indoor,
|
CASE WHEN indoor=TRUE THEN 1 END as indoor,
|
||||||
row_number() OVER (
|
row_number() OVER (
|
||||||
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
|
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
|
||||||
ORDER BY CASE WHEN name = '' THEN 2000 ELSE poi_class_rank(poi_class(subclass, mapping_key)) END ASC
|
ORDER BY CASE WHEN name = '' THEN 2000 ELSE poi_class_rank(poi_class(subclass, mapping_key)) END ASC
|
||||||
|
@ -70,4 +70,6 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, name_de
|
||||||
) as poi_union
|
) as poi_union
|
||||||
ORDER BY "rank"
|
ORDER BY "rank"
|
||||||
;
|
;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -381,11 +381,11 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_poi_point
|
# etldoc: imposm3 -> osm_poi_point
|
||||||
poi_point:
|
poi_point:
|
||||||
type: point
|
type: point
|
||||||
fields: *poi_fields
|
columns: *poi_fields
|
||||||
mapping: *poi_mapping
|
mapping: *poi_mapping
|
||||||
|
|
||||||
# etldoc: imposm3 -> osm_poi_polygon
|
# etldoc: imposm3 -> osm_poi_polygon
|
||||||
poi_polygon:
|
poi_polygon:
|
||||||
type: polygon
|
type: polygon
|
||||||
fields: *poi_fields
|
columns: *poi_fields
|
||||||
mapping: *poi_mapping
|
mapping: *poi_mapping
|
||||||
|
|
|
@ -9,11 +9,91 @@ layer:
|
||||||
name: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Key:name) value of the POI.
|
name: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Key:name) value of the POI.
|
||||||
name_en: English name `name:en` if available, otherwise `name`.
|
name_en: English name `name:en` if available, otherwise `name`.
|
||||||
name_de: German name `name:de` if available, otherwise `name` or `name:en`.
|
name_de: German name `name:de` if available, otherwise `name` or `name:en`.
|
||||||
class: |
|
class:
|
||||||
|
description: |
|
||||||
More general classes of POIs. If there is no more general `class` for the `subclass`
|
More general classes of POIs. If there is no more general `class` for the `subclass`
|
||||||
this field will contain the same value as `subclass`.
|
this field will contain the same value as `subclass`.
|
||||||
But for example for schools you only need to style the class `school` to filter the subclasses `school`
|
But for example for schools you only need to style the class `school` to filter the subclasses `school`
|
||||||
and `kindergarten`. Or use the class `shop` to style all shops.
|
and `kindergarten`. Or use the class `shop` to style all shops.
|
||||||
|
values:
|
||||||
|
shop:
|
||||||
|
subclass: ['accessories', 'antiques', 'beauty', 'bed', 'boutique', 'camera', 'carpet', 'charity', 'chemist',
|
||||||
|
'coffee', 'computer', 'convenience', 'copyshop', 'cosmetics', 'garden_centre', 'doityourself',
|
||||||
|
'erotic', 'electronics', 'fabric', 'florist', 'frozen_food', 'furniture', 'video_games', 'video',
|
||||||
|
'general', 'gift', 'hardware', 'hearing_aids', 'hifi', 'ice_cream', 'interior_decoration',
|
||||||
|
'jewelry', 'kiosk', 'lamps', 'mall', 'massage', 'motorcycle', 'mobile_phone', 'newsagent',
|
||||||
|
'optician', 'outdoor', 'perfumery', 'perfume', 'pet', 'photo', 'second_hand', 'shoes', 'sports',
|
||||||
|
'stationery', 'tailor', 'tattoo', 'ticket', 'tobacco', 'toys', 'travel_agency', 'watches',
|
||||||
|
'weapons', 'wholesale']
|
||||||
|
town_hall:
|
||||||
|
subclass: ['townhall', 'public_building', 'courthouse', 'community_centre']
|
||||||
|
golf:
|
||||||
|
subclass: ['golf', 'golf_course', 'miniature_golf']
|
||||||
|
fast_food:
|
||||||
|
subclass: ['fast_food', 'food_court']
|
||||||
|
park:
|
||||||
|
subclass: ['park', 'bbq']
|
||||||
|
bus:
|
||||||
|
subclass: ['bus_stop', 'bus_station']
|
||||||
|
railway:
|
||||||
|
- __AND__:
|
||||||
|
subclass: 'station'
|
||||||
|
mapping_key: 'railway'
|
||||||
|
- subclass: ['halt', 'tram_stop', 'subway']
|
||||||
|
aerialway:
|
||||||
|
__AND__:
|
||||||
|
subclass: 'station'
|
||||||
|
mapping_key: 'aerialway'
|
||||||
|
entrance:
|
||||||
|
subclass: ['subway_entrance', 'train_station_entrance']
|
||||||
|
campsite:
|
||||||
|
subclass: ['camp_site', 'caravan_site']
|
||||||
|
laundry:
|
||||||
|
subclass: ['laundry', 'dry_cleaning']
|
||||||
|
grocery:
|
||||||
|
subclass: ['supermarket', 'deli', 'delicatessen', 'department_store', 'greengrocer', 'marketplace']
|
||||||
|
library:
|
||||||
|
subclass: ['books', 'library']
|
||||||
|
college:
|
||||||
|
subclass: ['university', 'college']
|
||||||
|
lodging:
|
||||||
|
subclass: ['hotel', 'motel', 'bed_and_breakfast', 'guest_house', 'hostel', 'chalet', 'alpine_hut', 'dormitory']
|
||||||
|
ice_cream:
|
||||||
|
subclass: ['chocolate', 'confectionery']
|
||||||
|
post:
|
||||||
|
subclass: ['post_box', 'post_office']
|
||||||
|
cafe:
|
||||||
|
subclass: ['cafe']
|
||||||
|
school:
|
||||||
|
subclass: ['school', 'kindergarten']
|
||||||
|
alcohol_shop:
|
||||||
|
subclass: ['alcohol', 'beverages', 'wine']
|
||||||
|
bar:
|
||||||
|
subclass: ['bar', 'nightclub']
|
||||||
|
harbor:
|
||||||
|
subclass: ['marina', 'dock']
|
||||||
|
car:
|
||||||
|
subclass: ['car', 'car_repair', 'taxi']
|
||||||
|
hospital:
|
||||||
|
subclass: ['hospital', 'nursing_home', 'clinic']
|
||||||
|
cemetery:
|
||||||
|
subclass: ['grave_yard', 'cemetery']
|
||||||
|
attraction:
|
||||||
|
subclass: ['attraction', 'viewpoint']
|
||||||
|
beer:
|
||||||
|
subclass: ['biergarten', 'pub']
|
||||||
|
music:
|
||||||
|
subclass: ['music', 'musical_instrument']
|
||||||
|
stadium:
|
||||||
|
subclass: ['american_football', 'stadium', 'soccer']
|
||||||
|
art_gallery:
|
||||||
|
subclass: ['art', 'artwork', 'gallery', 'arts_centre']
|
||||||
|
clothing_store:
|
||||||
|
subclass: ['bag', 'clothes']
|
||||||
|
swimming:
|
||||||
|
subclass: ['swimming_area', 'swimming']
|
||||||
|
castle:
|
||||||
|
subclass: ['castle', 'ruins']
|
||||||
subclass:
|
subclass:
|
||||||
description: |
|
description: |
|
||||||
Original value of either the
|
Original value of either the
|
||||||
|
|
|
@ -3,8 +3,7 @@ CREATE MATERIALIZED VIEW osm_poi_stop_centroid AS (
|
||||||
SELECT
|
SELECT
|
||||||
uic_ref,
|
uic_ref,
|
||||||
count(*) as count,
|
count(*) as count,
|
||||||
CASE WHEN count(*) > 2 THEN ST_Centroid(ST_UNION(geometry))
|
CASE WHEN count(*) > 2 THEN ST_Centroid(ST_UNION(geometry)) END AS centroid
|
||||||
ELSE NULL END AS centroid
|
|
||||||
FROM osm_poi_point
|
FROM osm_poi_point
|
||||||
WHERE
|
WHERE
|
||||||
nullif(uic_ref, '') IS NOT NULL
|
nullif(uic_ref, '') IS NOT NULL
|
||||||
|
@ -13,7 +12,7 @@ CREATE MATERIALIZED VIEW osm_poi_stop_centroid AS (
|
||||||
uic_ref
|
uic_ref
|
||||||
HAVING
|
HAVING
|
||||||
count(*) > 1
|
count(*) > 1
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
|
|
||||||
DROP MATERIALIZED VIEW IF EXISTS osm_poi_stop_rank CASCADE;
|
DROP MATERIALIZED VIEW IF EXISTS osm_poi_stop_rank CASCADE;
|
||||||
CREATE MATERIALIZED VIEW osm_poi_stop_rank AS (
|
CREATE MATERIALIZED VIEW osm_poi_stop_rank AS (
|
||||||
|
@ -33,7 +32,7 @@ CREATE MATERIALIZED VIEW osm_poi_stop_rank AS (
|
||||||
WHERE
|
WHERE
|
||||||
subclass IN ('bus_stop', 'bus_station', 'tram_stop', 'subway')
|
subclass IN ('bus_stop', 'bus_station', 'tram_stop', 'subway')
|
||||||
ORDER BY p.uic_ref, rk
|
ORDER BY p.uic_ref, rk
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
|
|
||||||
ALTER TABLE osm_poi_point ADD COLUMN IF NOT EXISTS agg_stop INTEGER DEFAULT NULL;
|
ALTER TABLE osm_poi_point ADD COLUMN IF NOT EXISTS agg_stop INTEGER DEFAULT NULL;
|
||||||
SELECT update_osm_poi_point_agg();
|
SELECT update_osm_poi_point_agg();
|
||||||
|
|
|
@ -27,7 +27,6 @@ BEGIN
|
||||||
SET agg_stop = CASE
|
SET agg_stop = CASE
|
||||||
WHEN p.subclass IN ('bus_stop', 'bus_station', 'tram_stop', 'subway')
|
WHEN p.subclass IN ('bus_stop', 'bus_station', 'tram_stop', 'subway')
|
||||||
THEN 1
|
THEN 1
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
|
|
||||||
UPDATE osm_poi_point p
|
UPDATE osm_poi_point p
|
||||||
|
@ -36,7 +35,6 @@ BEGIN
|
||||||
WHEN p.subclass IN ('bus_stop', 'bus_station', 'tram_stop', 'subway')
|
WHEN p.subclass IN ('bus_stop', 'bus_station', 'tram_stop', 'subway')
|
||||||
AND r.rk IS NULL OR r.rk = 1
|
AND r.rk IS NULL OR r.rk = 1
|
||||||
THEN 1
|
THEN 1
|
||||||
ELSE NULL
|
|
||||||
END)
|
END)
|
||||||
FROM osm_poi_stop_rank r
|
FROM osm_poi_stop_rank r
|
||||||
WHERE p.osm_id = r.osm_id
|
WHERE p.osm_id = r.osm_id
|
||||||
|
|
|
@ -3,36 +3,20 @@ CREATE OR REPLACE FUNCTION brunnel(is_bridge BOOL, is_tunnel BOOL, is_ford BOOL)
|
||||||
WHEN is_bridge THEN 'bridge'
|
WHEN is_bridge THEN 'bridge'
|
||||||
WHEN is_tunnel THEN 'tunnel'
|
WHEN is_tunnel THEN 'tunnel'
|
||||||
WHEN is_ford THEN 'ford'
|
WHEN is_ford THEN 'ford'
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE STRICT PARALLEL SAFE;
|
||||||
|
|
||||||
-- The classes for highways are derived from the classes used in ClearTables
|
-- The classes for highways are derived from the classes used in ClearTables
|
||||||
-- https://github.com/ClearTables/ClearTables/blob/master/transportation.lua
|
-- https://github.com/ClearTables/ClearTables/blob/master/transportation.lua
|
||||||
CREATE OR REPLACE FUNCTION highway_class(highway TEXT, public_transport TEXT, construction TEXT) RETURNS TEXT AS $$
|
CREATE OR REPLACE FUNCTION highway_class(highway TEXT, public_transport TEXT, construction TEXT) RETURNS TEXT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN highway IN ('motorway', 'motorway_link') THEN 'motorway'
|
%%FIELD_MAPPING: class %%
|
||||||
WHEN highway IN ('trunk', 'trunk_link') THEN 'trunk'
|
|
||||||
WHEN highway IN ('primary', 'primary_link') THEN 'primary'
|
|
||||||
WHEN highway IN ('secondary', 'secondary_link') THEN 'secondary'
|
|
||||||
WHEN highway IN ('tertiary', 'tertiary_link') THEN 'tertiary'
|
|
||||||
WHEN highway IN ('unclassified', 'residential', 'living_street', 'road') THEN 'minor'
|
|
||||||
WHEN highway IN ('pedestrian', 'path', 'footway', 'cycleway', 'steps', 'bridleway', 'corridor') OR public_transport IN ('platform') THEN 'path'
|
|
||||||
WHEN highway IN ('service', 'track', 'raceway') THEN highway
|
|
||||||
WHEN highway = 'construction' THEN CASE
|
|
||||||
WHEN construction IN ('motorway', 'motorway_link') THEN 'motorway_construction'
|
|
||||||
WHEN construction IN ('trunk', 'trunk_link') THEN 'trunk_construction'
|
|
||||||
WHEN construction IN ('primary', 'primary_link') THEN 'primary_construction'
|
|
||||||
WHEN construction IN ('secondary', 'secondary_link') THEN 'secondary_construction'
|
|
||||||
WHEN construction IN ('tertiary', 'tertiary_link') THEN 'tertiary_construction'
|
|
||||||
WHEN construction = '' OR construction IN ('unclassified', 'residential', 'living_street', 'road') THEN 'minor_construction'
|
|
||||||
WHEN construction IN ('pedestrian', 'path', 'footway', 'cycleway', 'steps', 'bridleway', 'corridor') OR public_transport IN ('platform') THEN 'path_construction'
|
|
||||||
WHEN construction IN ('service', 'track', 'raceway') THEN CONCAT(highway, '_construction')
|
|
||||||
ELSE NULL
|
|
||||||
END
|
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
||||||
-- The classes for railways are derived from the classes used in ClearTables
|
-- The classes for railways are derived from the classes used in ClearTables
|
||||||
-- https://github.com/ClearTables/ClearTables/blob/master/transportation.lua
|
-- https://github.com/ClearTables/ClearTables/blob/master/transportation.lua
|
||||||
|
@ -40,18 +24,20 @@ CREATE OR REPLACE FUNCTION railway_class(railway TEXT) RETURNS TEXT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN railway IN ('rail', 'narrow_gauge', 'preserved', 'funicular') THEN 'rail'
|
WHEN railway IN ('rail', 'narrow_gauge', 'preserved', 'funicular') THEN 'rail'
|
||||||
WHEN railway IN ('subway', 'light_rail', 'monorail', 'tram') THEN 'transit'
|
WHEN railway IN ('subway', 'light_rail', 'monorail', 'tram') THEN 'transit'
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE STRICT PARALLEL SAFE;
|
||||||
|
|
||||||
-- Limit service to only the most important values to ensure
|
-- Limit service to only the most important values to ensure
|
||||||
-- we always know the values of service
|
-- we always know the values of service
|
||||||
CREATE OR REPLACE FUNCTION service_value(service TEXT) RETURNS TEXT AS $$
|
CREATE OR REPLACE FUNCTION service_value(service TEXT) RETURNS TEXT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN service IN ('spur', 'yard', 'siding', 'crossover', 'driveway', 'alley', 'parking_aisle') THEN service
|
WHEN service IN ('spur', 'yard', 'siding', 'crossover', 'driveway', 'alley', 'parking_aisle') THEN service
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE STRICT PARALLEL SAFE;
|
||||||
|
|
||||||
-- Limit surface to only the most important values to ensure
|
-- Limit surface to only the most important values to ensure
|
||||||
-- we always know the values of surface
|
-- we always know the values of surface
|
||||||
|
@ -59,6 +45,7 @@ CREATE OR REPLACE FUNCTION surface_value(surface TEXT) RETURNS TEXT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'concrete', 'concrete:lanes', 'concrete:plates', 'metal', 'paving_stones', 'sett', 'unhewn_cobblestone', 'wood') THEN 'paved'
|
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'concrete', 'concrete:lanes', 'concrete:plates', 'metal', 'paving_stones', 'sett', 'unhewn_cobblestone', 'wood') THEN 'paved'
|
||||||
WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'gravel_turf', 'ground', 'ice', 'mud', 'pebblestone', 'salt', 'sand', 'snow', 'woodchips') THEN 'unpaved'
|
WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'gravel_turf', 'ground', 'ice', 'mud', 'pebblestone', 'salt', 'sand', 'snow', 'woodchips') THEN 'unpaved'
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE STRICT PARALLEL SAFE;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
CREATE OR REPLACE FUNCTION highway_is_link(highway TEXT) RETURNS BOOLEAN AS $$
|
CREATE OR REPLACE FUNCTION highway_is_link(highway TEXT) RETURNS BOOLEAN AS $$
|
||||||
SELECT highway LIKE '%_link';
|
SELECT highway LIKE '%_link';
|
||||||
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE STRICT PARALLEL SAFE;
|
||||||
|
|
||||||
|
|
||||||
-- etldoc: layer_transportation[shape=record fillcolor=lightpink, style="rounded,filled",
|
-- etldoc: layer_transportation[shape=record fillcolor=lightpink, style="rounded,filled",
|
||||||
|
@ -23,7 +25,6 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
|
||||||
WHEN (highway IS NOT NULL OR public_transport IS NOT NULL)
|
WHEN (highway IS NOT NULL OR public_transport IS NOT NULL)
|
||||||
AND highway_class(highway, public_transport, construction) = 'path'
|
AND highway_class(highway, public_transport, construction) = 'path'
|
||||||
THEN COALESCE(NULLIF(public_transport, ''), highway)
|
THEN COALESCE(NULLIF(public_transport, ''), highway)
|
||||||
ELSE NULL
|
|
||||||
END AS subclass,
|
END AS subclass,
|
||||||
-- All links are considered as ramps as well
|
-- All links are considered as ramps as well
|
||||||
CASE WHEN highway_is_link(highway) OR highway = 'steps'
|
CASE WHEN highway_is_link(highway) OR highway = 'steps'
|
||||||
|
@ -33,7 +34,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
|
||||||
NULLIF(service, '') AS service,
|
NULLIF(service, '') AS service,
|
||||||
NULLIF(layer, 0) AS layer,
|
NULLIF(layer, 0) AS layer,
|
||||||
"level",
|
"level",
|
||||||
CASE WHEN indoor=TRUE THEN 1 ELSE NULL END as indoor,
|
CASE WHEN indoor=TRUE THEN 1 END as indoor,
|
||||||
NULLIF(bicycle, '') AS bicycle,
|
NULLIF(bicycle, '') AS bicycle,
|
||||||
NULLIF(foot, '') AS foot,
|
NULLIF(foot, '') AS foot,
|
||||||
NULLIF(horse, '') AS horse,
|
NULLIF(horse, '') AS horse,
|
||||||
|
@ -157,12 +158,8 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
|
||||||
public_transport, service_value(service) AS service,
|
public_transport, service_value(service) AS service,
|
||||||
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, man_made,
|
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, man_made,
|
||||||
layer,
|
layer,
|
||||||
CASE WHEN highway IN ('footway', 'steps') THEN "level"
|
CASE WHEN highway IN ('footway', 'steps') THEN "level" END AS "level",
|
||||||
ELSE NULL::int
|
CASE WHEN highway IN ('footway', 'steps') THEN indoor END AS indoor,
|
||||||
END AS "level",
|
|
||||||
CASE WHEN highway IN ('footway', 'steps') THEN indoor
|
|
||||||
ELSE NULL::boolean
|
|
||||||
END AS indoor,
|
|
||||||
bicycle, foot, horse, mtb_scale,
|
bicycle, foot, horse, mtb_scale,
|
||||||
surface_value(surface) AS "surface",
|
surface_value(surface) AS "surface",
|
||||||
z_order
|
z_order
|
||||||
|
@ -371,4 +368,6 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
|
||||||
) AS zoom_levels
|
) AS zoom_levels
|
||||||
WHERE geometry && bbox
|
WHERE geometry && bbox
|
||||||
ORDER BY z_order ASC;
|
ORDER BY z_order ASC;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -158,7 +158,8 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_highway_linestring
|
# etldoc: imposm3 -> osm_highway_linestring
|
||||||
highway_linestring:
|
highway_linestring:
|
||||||
type: linestring
|
type: linestring
|
||||||
fields:
|
_resolve_wikidata: false
|
||||||
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -231,7 +232,8 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_railway_linestring
|
# etldoc: imposm3 -> osm_railway_linestring
|
||||||
railway_linestring:
|
railway_linestring:
|
||||||
type: linestring
|
type: linestring
|
||||||
fields:
|
_resolve_wikidata: false
|
||||||
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -273,7 +275,8 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_aerialway_linestring
|
# etldoc: imposm3 -> osm_aerialway_linestring
|
||||||
aerialway_linestring:
|
aerialway_linestring:
|
||||||
type: linestring
|
type: linestring
|
||||||
fields:
|
_resolve_wikidata: false
|
||||||
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -305,7 +308,8 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_shipway_linestring
|
# etldoc: imposm3 -> osm_shipway_linestring
|
||||||
shipway_linestring:
|
shipway_linestring:
|
||||||
type: linestring
|
type: linestring
|
||||||
fields:
|
_resolve_wikidata: false
|
||||||
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
@ -336,7 +340,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_highway_polygon
|
# etldoc: imposm3 -> osm_highway_polygon
|
||||||
highway_polygon:
|
highway_polygon:
|
||||||
type: polygon
|
type: polygon
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 114 KiB Po Szerokość: | Wysokość: | Rozmiar: 134 KiB |
|
@ -24,33 +24,69 @@ layer:
|
||||||
shipping ways), or
|
shipping ways), or
|
||||||
[`man_made`](http://wiki.openstreetmap.org/wiki/Key:route).
|
[`man_made`](http://wiki.openstreetmap.org/wiki/Key:route).
|
||||||
values:
|
values:
|
||||||
- motorway
|
motorway:
|
||||||
- trunk
|
highway: ['motorway', 'motorway_link']
|
||||||
- primary
|
trunk:
|
||||||
- secondary
|
highway: ['trunk', 'trunk_link']
|
||||||
- tertiary
|
primary:
|
||||||
- minor
|
highway: ['primary', 'primary_link']
|
||||||
- service
|
secondary:
|
||||||
- track
|
highway: ['secondary', 'secondary_link']
|
||||||
- path
|
tertiary:
|
||||||
- raceway
|
highway: ['tertiary', 'tertiary_link']
|
||||||
- motorway_construction
|
minor:
|
||||||
- trunk_construction
|
highway: ['unclassified', 'residential', 'living_street', 'road']
|
||||||
- primary_construction
|
path:
|
||||||
- secondary_construction
|
highway: ['pedestrian', 'path', 'footway', 'cycleway', 'steps', 'bridleway', 'corridor']
|
||||||
- tertiary_construction
|
public_transport: 'platform'
|
||||||
- minor_construction
|
service:
|
||||||
- service_construction
|
highway: service
|
||||||
- track_construction
|
track:
|
||||||
- path_construction
|
highway: track
|
||||||
- raceway_construction
|
raceway:
|
||||||
- rail
|
highway: raceway
|
||||||
- transit
|
motorway_construction:
|
||||||
- cable_car
|
__AND__:
|
||||||
- gondola
|
highway: construction
|
||||||
- ferry
|
construction: ['motorway', 'motorway_link']
|
||||||
- bridge
|
trunk_construction:
|
||||||
- pier
|
__AND__:
|
||||||
|
highway: construction
|
||||||
|
construction: ['trunk', 'trunk_link']
|
||||||
|
primary_construction:
|
||||||
|
__AND__:
|
||||||
|
highway: construction
|
||||||
|
construction: ['primary', 'primary_link']
|
||||||
|
secondary_construction:
|
||||||
|
__AND__:
|
||||||
|
highway: construction
|
||||||
|
construction: ['secondary', 'secondary_link']
|
||||||
|
tertiary_construction:
|
||||||
|
__AND__:
|
||||||
|
highway: construction
|
||||||
|
construction: ['tertiary', 'tertiary_link']
|
||||||
|
minor_construction:
|
||||||
|
__AND__:
|
||||||
|
highway: construction
|
||||||
|
construction: ['', 'unclassified', 'residential', 'living_street', 'road']
|
||||||
|
path_construction:
|
||||||
|
__AND__:
|
||||||
|
- highway: construction
|
||||||
|
- __OR__:
|
||||||
|
construction: ['pedestrian', 'path', 'footway', 'cycleway', 'steps', 'bridleway', 'corridor']
|
||||||
|
public_transport: platform
|
||||||
|
service_construction:
|
||||||
|
__AND__:
|
||||||
|
highway: construction
|
||||||
|
construction: service
|
||||||
|
track_construction:
|
||||||
|
__AND__:
|
||||||
|
highway: construction
|
||||||
|
construction: track
|
||||||
|
raceway_construction:
|
||||||
|
__AND__:
|
||||||
|
highway: construction
|
||||||
|
construction: raceway
|
||||||
subclass:
|
subclass:
|
||||||
description: |
|
description: |
|
||||||
Distinguish more specific classes of railway and path:
|
Distinguish more specific classes of railway and path:
|
||||||
|
|
|
@ -41,7 +41,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring AS (
|
||||||
AND ST_IsValid(geometry)
|
AND ST_IsValid(geometry)
|
||||||
group by highway, construction
|
group by highway, construction
|
||||||
) AS highway_union
|
) AS highway_union
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_geometry_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_geometry_idx
|
||||||
ON osm_transportation_merge_linestring USING gist(geometry);
|
ON osm_transportation_merge_linestring USING gist(geometry);
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_highway_partial_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_highway_partial_idx
|
||||||
|
@ -54,7 +54,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen3 AS (
|
||||||
FROM osm_transportation_merge_linestring
|
FROM osm_transportation_merge_linestring
|
||||||
WHERE highway IN ('motorway','trunk', 'primary')
|
WHERE highway IN ('motorway','trunk', 'primary')
|
||||||
OR highway = 'construction' AND construction IN ('motorway','trunk', 'primary')
|
OR highway = 'construction' AND construction IN ('motorway','trunk', 'primary')
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen3_geometry_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen3_geometry_idx
|
||||||
ON osm_transportation_merge_linestring_gen3 USING gist(geometry);
|
ON osm_transportation_merge_linestring_gen3 USING gist(geometry);
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen3_highway_partial_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen3_highway_partial_idx
|
||||||
|
@ -67,7 +67,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen4 AS (
|
||||||
FROM osm_transportation_merge_linestring_gen3
|
FROM osm_transportation_merge_linestring_gen3
|
||||||
WHERE (highway IN ('motorway','trunk', 'primary') OR highway = 'construction' AND construction IN ('motorway','trunk', 'primary'))
|
WHERE (highway IN ('motorway','trunk', 'primary') OR highway = 'construction' AND construction IN ('motorway','trunk', 'primary'))
|
||||||
AND ST_Length(geometry) > 50
|
AND ST_Length(geometry) > 50
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen4_geometry_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen4_geometry_idx
|
||||||
ON osm_transportation_merge_linestring_gen4 USING gist(geometry);
|
ON osm_transportation_merge_linestring_gen4 USING gist(geometry);
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen4_highway_partial_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen4_highway_partial_idx
|
||||||
|
@ -80,7 +80,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen5 AS (
|
||||||
FROM osm_transportation_merge_linestring_gen4
|
FROM osm_transportation_merge_linestring_gen4
|
||||||
WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk'))
|
WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk'))
|
||||||
AND ST_Length(geometry) > 100
|
AND ST_Length(geometry) > 100
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen5_geometry_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen5_geometry_idx
|
||||||
ON osm_transportation_merge_linestring_gen5 USING gist(geometry);
|
ON osm_transportation_merge_linestring_gen5 USING gist(geometry);
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen5_highway_partial_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen5_highway_partial_idx
|
||||||
|
@ -92,7 +92,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen6 AS (
|
||||||
SELECT ST_Simplify(geometry, 1000) AS geometry, osm_id, highway, construction, z_order
|
SELECT ST_Simplify(geometry, 1000) AS geometry, osm_id, highway, construction, z_order
|
||||||
FROM osm_transportation_merge_linestring_gen5
|
FROM osm_transportation_merge_linestring_gen5
|
||||||
WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk')) AND ST_Length(geometry) > 500
|
WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk')) AND ST_Length(geometry) > 500
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen6_geometry_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen6_geometry_idx
|
||||||
ON osm_transportation_merge_linestring_gen6 USING gist(geometry);
|
ON osm_transportation_merge_linestring_gen6 USING gist(geometry);
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen6_highway_partial_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen6_highway_partial_idx
|
||||||
|
@ -104,7 +104,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen7 AS (
|
||||||
SELECT ST_Simplify(geometry, 2000) AS geometry, osm_id, highway, construction, z_order
|
SELECT ST_Simplify(geometry, 2000) AS geometry, osm_id, highway, construction, z_order
|
||||||
FROM osm_transportation_merge_linestring_gen6
|
FROM osm_transportation_merge_linestring_gen6
|
||||||
WHERE (highway = 'motorway' OR highway = 'construction' AND construction = 'motorway') AND ST_Length(geometry) > 1000
|
WHERE (highway = 'motorway' OR highway = 'construction' AND construction = 'motorway') AND ST_Length(geometry) > 1000
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen7_geometry_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen7_geometry_idx
|
||||||
ON osm_transportation_merge_linestring_gen7 USING gist(geometry);
|
ON osm_transportation_merge_linestring_gen7 USING gist(geometry);
|
||||||
|
|
||||||
|
|
|
@ -23,11 +23,10 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
|
||||||
CASE
|
CASE
|
||||||
WHEN highway IS NOT NULL AND highway_class(highway, '', construction) = 'path'
|
WHEN highway IS NOT NULL AND highway_class(highway, '', construction) = 'path'
|
||||||
THEN highway
|
THEN highway
|
||||||
ELSE NULL
|
|
||||||
END AS subclass,
|
END AS subclass,
|
||||||
NULLIF(layer, 0) AS layer,
|
NULLIF(layer, 0) AS layer,
|
||||||
"level",
|
"level",
|
||||||
CASE WHEN indoor=TRUE THEN 1 ELSE NULL END as indoor
|
CASE WHEN indoor=TRUE THEN 1 END as indoor
|
||||||
FROM (
|
FROM (
|
||||||
|
|
||||||
-- etldoc: osm_transportation_name_linestring_gen4 -> layer_transportation_name:z6
|
-- etldoc: osm_transportation_name_linestring_gen4 -> layer_transportation_name:z6
|
||||||
|
@ -127,4 +126,6 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
|
||||||
) AS zoom_levels
|
) AS zoom_levels
|
||||||
WHERE geometry && bbox
|
WHERE geometry && bbox
|
||||||
ORDER BY z_order ASC;
|
ORDER BY z_order ASC;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 114 KiB Po Szerokość: | Wysokość: | Rozmiar: 134 KiB |
|
@ -56,7 +56,6 @@ BEGIN
|
||||||
THEN 'ca-transcanada'::route_network_type
|
THEN 'ca-transcanada'::route_network_type
|
||||||
WHEN network = 'omt-gb-motorway' THEN 'gb-motorway'::route_network_type
|
WHEN network = 'omt-gb-motorway' THEN 'gb-motorway'::route_network_type
|
||||||
WHEN network = 'omt-gb-trunk' THEN 'gb-trunk'::route_network_type
|
WHEN network = 'omt-gb-trunk' THEN 'gb-trunk'::route_network_type
|
||||||
ELSE NULL
|
|
||||||
END
|
END
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -25,21 +25,15 @@ CREATE MATERIALIZED VIEW osm_transportation_name_network AS (
|
||||||
end as ref,
|
end as ref,
|
||||||
hl.highway,
|
hl.highway,
|
||||||
hl.construction,
|
hl.construction,
|
||||||
CASE WHEN highway IN ('footway', 'steps') THEN layer
|
CASE WHEN highway IN ('footway', 'steps') THEN layer END AS layer,
|
||||||
ELSE NULL::int
|
CASE WHEN highway IN ('footway', 'steps') THEN "level" END AS "level",
|
||||||
END AS layer,
|
CASE WHEN highway IN ('footway', 'steps') THEN indoor END AS indoor,
|
||||||
CASE WHEN highway IN ('footway', 'steps') THEN "level"
|
|
||||||
ELSE NULL::int
|
|
||||||
END AS "level",
|
|
||||||
CASE WHEN highway IN ('footway', 'steps') THEN indoor
|
|
||||||
ELSE NULL::boolean
|
|
||||||
END AS indoor,
|
|
||||||
ROW_NUMBER() OVER(PARTITION BY hl.osm_id
|
ROW_NUMBER() OVER(PARTITION BY hl.osm_id
|
||||||
ORDER BY rm.network_type) AS "rank",
|
ORDER BY rm.network_type) AS "rank",
|
||||||
hl.z_order
|
hl.z_order
|
||||||
FROM osm_highway_linestring hl
|
FROM osm_highway_linestring hl
|
||||||
left join osm_route_member rm on (rm.member = hl.osm_id)
|
left join osm_route_member rm on (rm.member = hl.osm_id)
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_network_geometry_idx ON osm_transportation_name_network USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_network_geometry_idx ON osm_transportation_name_network USING gist(geometry);
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,7 +76,7 @@ CREATE MATERIALIZED VIEW osm_transportation_name_linestring AS (
|
||||||
AND NULLIF(highway, '') IS NOT NULL
|
AND NULLIF(highway, '') IS NOT NULL
|
||||||
group by name, name_en, name_de, ref, highway, construction, "level", layer, indoor, network_type
|
group by name, name_en, name_de, ref, highway, construction, "level", layer, indoor, network_type
|
||||||
) AS highway_union
|
) AS highway_union
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_geometry_idx ON osm_transportation_name_linestring USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_geometry_idx ON osm_transportation_name_linestring USING gist(geometry);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_highway_partial_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_highway_partial_idx
|
||||||
|
@ -94,7 +88,7 @@ CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen1 AS (
|
||||||
SELECT ST_Simplify(geometry, 50) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
|
SELECT ST_Simplify(geometry, 50) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
|
||||||
FROM osm_transportation_name_linestring
|
FROM osm_transportation_name_linestring
|
||||||
WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk')) AND ST_Length(geometry) > 8000
|
WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk')) AND ST_Length(geometry) > 8000
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen1_geometry_idx ON osm_transportation_name_linestring_gen1 USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen1_geometry_idx ON osm_transportation_name_linestring_gen1 USING gist(geometry);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen1_highway_partial_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen1_highway_partial_idx
|
||||||
|
@ -106,7 +100,7 @@ CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen2 AS (
|
||||||
SELECT ST_Simplify(geometry, 120) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
|
SELECT ST_Simplify(geometry, 120) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
|
||||||
FROM osm_transportation_name_linestring_gen1
|
FROM osm_transportation_name_linestring_gen1
|
||||||
WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk')) AND ST_Length(geometry) > 14000
|
WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk')) AND ST_Length(geometry) > 14000
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen2_geometry_idx ON osm_transportation_name_linestring_gen2 USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen2_geometry_idx ON osm_transportation_name_linestring_gen2 USING gist(geometry);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen2_highway_partial_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen2_highway_partial_idx
|
||||||
|
@ -118,7 +112,7 @@ CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen3 AS (
|
||||||
SELECT ST_Simplify(geometry, 200) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
|
SELECT ST_Simplify(geometry, 200) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
|
||||||
FROM osm_transportation_name_linestring_gen2
|
FROM osm_transportation_name_linestring_gen2
|
||||||
WHERE (highway = 'motorway' OR highway = 'construction' AND construction = 'motorway') AND ST_Length(geometry) > 20000
|
WHERE (highway = 'motorway' OR highway = 'construction' AND construction = 'motorway') AND ST_Length(geometry) > 20000
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen3_geometry_idx ON osm_transportation_name_linestring_gen3 USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen3_geometry_idx ON osm_transportation_name_linestring_gen3 USING gist(geometry);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen3_highway_partial_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen3_highway_partial_idx
|
||||||
|
@ -130,7 +124,7 @@ CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen4 AS (
|
||||||
SELECT ST_Simplify(geometry, 500) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
|
SELECT ST_Simplify(geometry, 500) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
|
||||||
FROM osm_transportation_name_linestring_gen3
|
FROM osm_transportation_name_linestring_gen3
|
||||||
WHERE (highway = 'motorway' OR highway = 'construction' AND construction = 'motorway') AND ST_Length(geometry) > 20000
|
WHERE (highway = 'motorway' OR highway = 'construction' AND construction = 'motorway') AND ST_Length(geometry) > 20000
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen4_geometry_idx ON osm_transportation_name_linestring_gen4 USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen4_geometry_idx ON osm_transportation_name_linestring_gen4 USING gist(geometry);
|
||||||
|
|
||||||
-- Handle updates
|
-- Handle updates
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 274 KiB Po Szerokość: | Wysokość: | Rozmiar: 298 KiB |
|
@ -49,7 +49,7 @@ tables:
|
||||||
|
|
||||||
# etldoc: imposm3 -> osm_water_polygon
|
# etldoc: imposm3 -> osm_water_polygon
|
||||||
water_polygon:
|
water_polygon:
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
|
@ -1,20 +1,66 @@
|
||||||
|
-- This statement can be deleted after the water importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_ocean_polygon_gen1 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_ocean_polygon -> osm_ocean_polygon_gen1
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_ocean_polygon_gen1 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_ocean_polygon_gen1 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 20) AS geometry
|
||||||
|
FROM osm_ocean_polygon
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_ocean_polygon_gen1_idx ON osm_ocean_polygon_gen1 USING gist (geometry);
|
||||||
|
|
||||||
|
|
||||||
|
-- This statement can be deleted after the water importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_ocean_polygon_gen2 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_ocean_polygon -> osm_ocean_polygon_gen2
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_ocean_polygon_gen2 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_ocean_polygon_gen2 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 40) AS geometry
|
||||||
|
FROM osm_ocean_polygon
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_ocean_polygon_gen2_idx ON osm_ocean_polygon_gen2 USING gist (geometry);
|
||||||
|
|
||||||
|
|
||||||
|
-- This statement can be deleted after the water importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_ocean_polygon_gen3 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_ocean_polygon -> osm_ocean_polygon_gen3
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_ocean_polygon_gen3 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_ocean_polygon_gen3 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 80) AS geometry
|
||||||
|
FROM osm_ocean_polygon
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_ocean_polygon_gen3_idx ON osm_ocean_polygon_gen3 USING gist (geometry);
|
||||||
|
|
||||||
|
|
||||||
|
-- This statement can be deleted after the water importer image stops creating this object as a table
|
||||||
|
DO $$ BEGIN DROP TABLE IF EXISTS osm_ocean_polygon_gen4 CASCADE; EXCEPTION WHEN wrong_object_type THEN END; $$ language 'plpgsql';
|
||||||
|
-- etldoc: osm_ocean_polygon -> osm_ocean_polygon_gen4
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS osm_ocean_polygon_gen4 CASCADE;
|
||||||
|
CREATE MATERIALIZED VIEW osm_ocean_polygon_gen4 AS (
|
||||||
|
SELECT ST_Simplify(geometry, 160) AS geometry
|
||||||
|
FROM osm_ocean_polygon
|
||||||
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
|
||||||
|
CREATE INDEX IF NOT EXISTS osm_ocean_polygon_gen4_idx ON osm_ocean_polygon_gen4 USING gist (geometry);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION water_class(waterway TEXT) RETURNS TEXT AS $$
|
CREATE OR REPLACE FUNCTION water_class(waterway TEXT) RETURNS TEXT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN waterway='' THEN 'lake'
|
%%FIELD_MAPPING: class %%
|
||||||
WHEN waterway='lake' THEN 'lake'
|
|
||||||
WHEN waterway='dock' THEN 'dock'
|
|
||||||
ELSE 'river'
|
ELSE 'river'
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION waterway_brunnel(is_bridge BOOL, is_tunnel BOOL) RETURNS TEXT AS $$
|
CREATE OR REPLACE FUNCTION waterway_brunnel(is_bridge BOOL, is_tunnel BOOL) RETURNS TEXT AS $$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN is_bridge THEN 'bridge'
|
WHEN is_bridge THEN 'bridge'
|
||||||
WHEN is_tunnel THEN 'tunnel'
|
WHEN is_tunnel THEN 'tunnel'
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE STRICT PARALLEL SAFE;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -333,4 +379,6 @@ RETURNS TABLE(geometry geometry, class text, brunnel text, intermittent int) AS
|
||||||
SELECT * FROM water_z14 WHERE zoom_level >= 14
|
SELECT * FROM water_z14 WHERE zoom_level >= 14
|
||||||
) AS zoom_levels
|
) AS zoom_levels
|
||||||
WHERE geometry && bbox;
|
WHERE geometry && bbox;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -14,9 +14,12 @@ layer:
|
||||||
All water polygons from [OpenStreetMapData](http://osmdata.openstreetmap.de/) have the class `ocean`.
|
All water polygons from [OpenStreetMapData](http://osmdata.openstreetmap.de/) have the class `ocean`.
|
||||||
Water bodies are classified as `lake` or `river` for water bodies with the [`waterway`](http://wiki.openstreetmap.org/wiki/Key:waterway) tag.
|
Water bodies are classified as `lake` or `river` for water bodies with the [`waterway`](http://wiki.openstreetmap.org/wiki/Key:waterway) tag.
|
||||||
values:
|
values:
|
||||||
- ocean
|
lake:
|
||||||
- lake
|
waterway: ['', 'lake']
|
||||||
- river
|
dock:
|
||||||
|
waterway: 'dock'
|
||||||
|
river:
|
||||||
|
ocean:
|
||||||
intermittent:
|
intermittent:
|
||||||
description: |
|
description: |
|
||||||
Mark with `1` if it is an [intermittent](http://wiki.openstreetmap.org/wiki/Key:intermittent) water polygon.
|
Mark with `1` if it is an [intermittent](http://wiki.openstreetmap.org/wiki/Key:intermittent) water polygon.
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 134 KiB Po Szerokość: | Wysokość: | Rozmiar: 132 KiB |
|
@ -54,4 +54,6 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, name_de
|
||||||
OR (zoom_level >= "rank" AND "rank" IS NOT NULL)
|
OR (zoom_level >= "rank" AND "rank" IS NOT NULL)
|
||||||
OR (zoom_level >= 8)
|
OR (zoom_level >= 8)
|
||||||
);
|
);
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -2,7 +2,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_marine_point
|
# etldoc: imposm3 -> osm_marine_point
|
||||||
marine_point:
|
marine_point:
|
||||||
type: point
|
type: point
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 22 KiB Po Szerokość: | Wysokość: | Rozmiar: 26 KiB |
|
@ -15,7 +15,7 @@ CREATE MATERIALIZED VIEW osm_water_lakeline AS (
|
||||||
FROM osm_water_polygon AS wp
|
FROM osm_water_polygon AS wp
|
||||||
INNER JOIN lake_centerline ll ON wp.osm_id = ll.osm_id
|
INNER JOIN lake_centerline ll ON wp.osm_id = ll.osm_id
|
||||||
WHERE wp.name <> '' AND ST_IsValid(wp.geometry)
|
WHERE wp.name <> '' AND ST_IsValid(wp.geometry)
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_water_lakeline_geometry_idx ON osm_water_lakeline USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_water_lakeline_geometry_idx ON osm_water_lakeline USING gist(geometry);
|
||||||
|
|
||||||
-- Handle updates
|
-- Handle updates
|
||||||
|
|
|
@ -15,7 +15,7 @@ CREATE MATERIALIZED VIEW osm_water_point AS (
|
||||||
FROM osm_water_polygon AS wp
|
FROM osm_water_polygon AS wp
|
||||||
LEFT JOIN lake_centerline ll ON wp.osm_id = ll.osm_id
|
LEFT JOIN lake_centerline ll ON wp.osm_id = ll.osm_id
|
||||||
WHERE ll.osm_id IS NULL AND wp.name <> ''
|
WHERE ll.osm_id IS NULL AND wp.name <> ''
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_water_point_geometry_idx ON osm_water_point USING gist (geometry);
|
CREATE INDEX IF NOT EXISTS osm_water_point_geometry_idx ON osm_water_point USING gist (geometry);
|
||||||
|
|
||||||
-- Handle updates
|
-- Handle updates
|
||||||
|
|
|
@ -28,7 +28,7 @@ tables:
|
||||||
# etldoc: imposm3 -> osm_waterway_linestring
|
# etldoc: imposm3 -> osm_waterway_linestring
|
||||||
waterway_linestring:
|
waterway_linestring:
|
||||||
type: linestring
|
type: linestring
|
||||||
fields:
|
columns:
|
||||||
- name: osm_id
|
- name: osm_id
|
||||||
type: id
|
type: id
|
||||||
- name: geometry
|
- name: geometry
|
||||||
|
|
|
@ -30,7 +30,7 @@ CREATE MATERIALIZED VIEW osm_important_waterway_linestring AS (
|
||||||
WHERE name <> '' AND waterway = 'river' AND ST_IsValid(geometry)
|
WHERE name <> '' AND waterway = 'river' AND ST_IsValid(geometry)
|
||||||
GROUP BY name, name_en, name_de, slice_language_tags(tags)
|
GROUP BY name, name_en, name_de, slice_language_tags(tags)
|
||||||
) AS waterway_union
|
) AS waterway_union
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_geometry_idx ON osm_important_waterway_linestring USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_geometry_idx ON osm_important_waterway_linestring USING gist(geometry);
|
||||||
|
|
||||||
-- etldoc: osm_important_waterway_linestring -> osm_important_waterway_linestring_gen1
|
-- etldoc: osm_important_waterway_linestring -> osm_important_waterway_linestring_gen1
|
||||||
|
@ -38,7 +38,7 @@ CREATE MATERIALIZED VIEW osm_important_waterway_linestring_gen1 AS (
|
||||||
SELECT ST_Simplify(geometry, 60) AS geometry, name, name_en, name_de, tags
|
SELECT ST_Simplify(geometry, 60) AS geometry, name, name_en, name_de, tags
|
||||||
FROM osm_important_waterway_linestring
|
FROM osm_important_waterway_linestring
|
||||||
WHERE ST_Length(geometry) > 1000
|
WHERE ST_Length(geometry) > 1000
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen1_geometry_idx ON osm_important_waterway_linestring_gen1 USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen1_geometry_idx ON osm_important_waterway_linestring_gen1 USING gist(geometry);
|
||||||
|
|
||||||
-- etldoc: osm_important_waterway_linestring_gen1 -> osm_important_waterway_linestring_gen2
|
-- etldoc: osm_important_waterway_linestring_gen1 -> osm_important_waterway_linestring_gen2
|
||||||
|
@ -46,7 +46,7 @@ CREATE MATERIALIZED VIEW osm_important_waterway_linestring_gen2 AS (
|
||||||
SELECT ST_Simplify(geometry, 100) AS geometry, name, name_en, name_de, tags
|
SELECT ST_Simplify(geometry, 100) AS geometry, name, name_en, name_de, tags
|
||||||
FROM osm_important_waterway_linestring_gen1
|
FROM osm_important_waterway_linestring_gen1
|
||||||
WHERE ST_Length(geometry) > 4000
|
WHERE ST_Length(geometry) > 4000
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen2_geometry_idx ON osm_important_waterway_linestring_gen2 USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen2_geometry_idx ON osm_important_waterway_linestring_gen2 USING gist(geometry);
|
||||||
|
|
||||||
-- etldoc: osm_important_waterway_linestring_gen2 -> osm_important_waterway_linestring_gen3
|
-- etldoc: osm_important_waterway_linestring_gen2 -> osm_important_waterway_linestring_gen3
|
||||||
|
@ -54,7 +54,7 @@ CREATE MATERIALIZED VIEW osm_important_waterway_linestring_gen3 AS (
|
||||||
SELECT ST_Simplify(geometry, 200) AS geometry, name, name_en, name_de, tags
|
SELECT ST_Simplify(geometry, 200) AS geometry, name, name_en, name_de, tags
|
||||||
FROM osm_important_waterway_linestring_gen2
|
FROM osm_important_waterway_linestring_gen2
|
||||||
WHERE ST_Length(geometry) > 8000
|
WHERE ST_Length(geometry) > 8000
|
||||||
);
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen3_geometry_idx ON osm_important_waterway_linestring_gen3 USING gist(geometry);
|
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen3_geometry_idx ON osm_important_waterway_linestring_gen3 USING gist(geometry);
|
||||||
|
|
||||||
-- Handle updates
|
-- Handle updates
|
||||||
|
|
|
@ -2,9 +2,10 @@ CREATE OR REPLACE FUNCTION waterway_brunnel(is_bridge BOOL, is_tunnel BOOL) RETU
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
WHEN is_bridge THEN 'bridge'
|
WHEN is_bridge THEN 'bridge'
|
||||||
WHEN is_tunnel THEN 'tunnel'
|
WHEN is_tunnel THEN 'tunnel'
|
||||||
ELSE NULL
|
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE STRICT PARALLEL SAFE;
|
||||||
|
|
||||||
-- etldoc: ne_110m_rivers_lake_centerlines -> waterway_z3
|
-- etldoc: ne_110m_rivers_lake_centerlines -> waterway_z3
|
||||||
CREATE OR REPLACE VIEW waterway_z3 AS (
|
CREATE OR REPLACE VIEW waterway_z3 AS (
|
||||||
|
@ -106,4 +107,6 @@ RETURNS TABLE(geometry geometry, class text, name text, name_en text, name_de te
|
||||||
SELECT * FROM waterway_z14 WHERE zoom_level >= 14
|
SELECT * FROM waterway_z14 WHERE zoom_level >= 14
|
||||||
) AS zoom_levels
|
) AS zoom_levels
|
||||||
WHERE geometry && bbox;
|
WHERE geometry && bbox;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$
|
||||||
|
LANGUAGE SQL
|
||||||
|
IMMUTABLE PARALLEL SAFE;
|
||||||
|
|
|
@ -28,7 +28,7 @@ tileset:
|
||||||
pixel_scale: 256
|
pixel_scale: 256
|
||||||
languages:
|
languages:
|
||||||
- am # Amharic
|
- am # Amharic
|
||||||
- ar # Arabic
|
- ar # Arabic
|
||||||
- az # Azerbaijani, Latin
|
- az # Azerbaijani, Latin
|
||||||
- be # Belarusian
|
- be # Belarusian
|
||||||
- bg # Bulgarian
|
- bg # Bulgarian
|
||||||
|
|
|
@ -39,7 +39,7 @@ githash=$( git rev-parse HEAD )
|
||||||
# Options to run with docker and docker-compose - ensure the container is destroyed on exit,
|
# Options to run with docker and docker-compose - ensure the container is destroyed on exit,
|
||||||
# as well as pass any other common parameters.
|
# as well as pass any other common parameters.
|
||||||
# In the future this should use -u $(id -u "$USER"):$(id -g "$USER") instead of running docker as root.
|
# In the future this should use -u $(id -u "$USER"):$(id -g "$USER") instead of running docker as root.
|
||||||
DC_OPTS="--rm"
|
DC_OPTS="--rm -u $(id -u "$USER"):$(id -g "$USER")"
|
||||||
|
|
||||||
log_file=./quickstart.log
|
log_file=./quickstart.log
|
||||||
rm -f $log_file
|
rm -f $log_file
|
||||||
|
@ -57,7 +57,7 @@ docker --version
|
||||||
docker-compose --version
|
docker-compose --version
|
||||||
|
|
||||||
# based on: http://stackoverflow.com/questions/16989598/bash-comparing-version-numbers
|
# based on: http://stackoverflow.com/questions/16989598/bash-comparing-version-numbers
|
||||||
function version { echo "$@" | tr -cs '0-9.' '.' | gawk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }'; }
|
function version { echo "$@" | tr -cs '0-9.' '.' | awk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }'; }
|
||||||
|
|
||||||
COMPOSE_VER=$(docker-compose version --short)
|
COMPOSE_VER=$(docker-compose version --short)
|
||||||
if [ "$(version "$COMPOSE_VER")" -lt "$(version "$MIN_COMPOSE_VER")" ]; then
|
if [ "$(version "$COMPOSE_VER")" -lt "$(version "$MIN_COMPOSE_VER")" ]; then
|
||||||
|
@ -130,11 +130,8 @@ docker images | grep openmaptiles
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
echo "====> : Making directories - if they don't exist ( ./build ./data ./pgdata ) "
|
echo "====> : Create directories if they don't exist"
|
||||||
mkdir -p pgdata
|
make init-dirs
|
||||||
mkdir -p build
|
|
||||||
mkdir -p data
|
|
||||||
mkdir -p wikidata
|
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
@ -186,7 +183,7 @@ echo "--------------------------------------------------------------------------
|
||||||
echo "====> : Start PostgreSQL service ; create PostgreSQL data volume "
|
echo "====> : Start PostgreSQL service ; create PostgreSQL data volume "
|
||||||
echo " : Source code: https://github.com/openmaptiles/postgis "
|
echo " : Source code: https://github.com/openmaptiles/postgis "
|
||||||
echo " : Thank you: https://www.postgresql.org ! Thank you http://postgis.org !"
|
echo " : Thank you: https://www.postgresql.org ! Thank you http://postgis.org !"
|
||||||
docker-compose up -d postgres
|
make db-start
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
@ -201,15 +198,7 @@ echo "====> : Start importing water data from http://osmdata.openstreetmap.de/ i
|
||||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-water "
|
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-water "
|
||||||
echo " : Data license: https://osmdata.openstreetmap.de/info/license.html "
|
echo " : Data license: https://osmdata.openstreetmap.de/info/license.html "
|
||||||
echo " : Thank you: https://osmdata.openstreetmap.de/info/ "
|
echo " : Thank you: https://osmdata.openstreetmap.de/info/ "
|
||||||
docker-compose run $DC_OPTS import-water
|
make import-water
|
||||||
|
|
||||||
echo " "
|
|
||||||
echo "-------------------------------------------------------------------------------------"
|
|
||||||
echo "====> : Start importing border data from http://openstreetmap.org into PostgreSQL "
|
|
||||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-osmborder"
|
|
||||||
echo " : Data license: http://www.openstreetmap.org/copyright"
|
|
||||||
echo " : Thank you: https://github.com/pnorman/osmborder "
|
|
||||||
docker-compose run $DC_OPTS import-osmborder
|
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
@ -217,7 +206,7 @@ echo "====> : Start importing http://www.naturalearthdata.com into PostgreSQL
|
||||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-natural-earth "
|
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-natural-earth "
|
||||||
echo " : Terms-of-use: http://www.naturalearthdata.com/about/terms-of-use "
|
echo " : Terms-of-use: http://www.naturalearthdata.com/about/terms-of-use "
|
||||||
echo " : Thank you: Natural Earth Contributors! "
|
echo " : Thank you: Natural Earth Contributors! "
|
||||||
docker-compose run $DC_OPTS import-natural-earth
|
make import-natural-earth
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
@ -225,7 +214,7 @@ echo "====> : Start importing OpenStreetMap Lakelines data "
|
||||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-lakelines "
|
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-lakelines "
|
||||||
echo " : https://github.com/lukasmartinelli/osm-lakelines "
|
echo " : https://github.com/lukasmartinelli/osm-lakelines "
|
||||||
echo " : Data license: .. "
|
echo " : Data license: .. "
|
||||||
docker-compose run $DC_OPTS import-lakelines
|
make import-lakelines
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
@ -235,23 +224,23 @@ echo " : Thank you Omniscale! "
|
||||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-osm "
|
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-osm "
|
||||||
echo " : The OpenstreetMap data license: https://www.openstreetmap.org/copyright (ODBL) "
|
echo " : The OpenstreetMap data license: https://www.openstreetmap.org/copyright (ODBL) "
|
||||||
echo " : Thank you OpenStreetMap Contributors ! "
|
echo " : Thank you OpenStreetMap Contributors ! "
|
||||||
docker-compose run $DC_OPTS import-osm
|
make import-osm
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
echo "====> : Start importing Wikidata: ./wikidata/latest-all.json.gz -> PostgreSQL"
|
echo "====> : Start importing border data from ./data/${testdata} into PostgreSQL using osmborder"
|
||||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-wikidata "
|
echo " : Source code: https://github.com/pnorman/osmborder"
|
||||||
echo " : The Wikidata license: https://www.wikidata.org/wiki/Wikidata:Database_download/en#License "
|
echo " : Data license: http://www.openstreetmap.org/copyright"
|
||||||
echo " : Thank you Wikidata Contributors ! "
|
echo " : Thank you: Paul Norman"
|
||||||
docker-compose run $DC_OPTS import-wikidata
|
make import-borders
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
echo "====> : Start SQL postprocessing: ./build/tileset.sql -> PostgreSQL "
|
echo "====> : Start SQL postprocessing: ./build/tileset.sql -> PostgreSQL "
|
||||||
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/tree/master/docker/import-sql "
|
echo " : Source code: https://github.com/openmaptiles/openmaptiles-tools/blob/master/bin/import-sql"
|
||||||
# If the output contains a WARNING, stop further processing
|
# If the output contains a WARNING, stop further processing
|
||||||
# Adapted from https://unix.stackexchange.com/questions/307562
|
# Adapted from https://unix.stackexchange.com/questions/307562
|
||||||
docker-compose run $DC_OPTS openmaptiles-tools import-sql | \
|
make import-sql | \
|
||||||
awk -v s=": WARNING:" '$0~s{print; print "\n*** WARNING detected, aborting"; exit(1)} 1'
|
awk -v s=": WARNING:" '$0~s{print; print "\n*** WARNING detected, aborting"; exit(1)} 1'
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
|
@ -259,6 +248,13 @@ echo "--------------------------------------------------------------------------
|
||||||
echo "====> : Analyze PostgreSQL tables"
|
echo "====> : Analyze PostgreSQL tables"
|
||||||
make psql-analyze
|
make psql-analyze
|
||||||
|
|
||||||
|
echo " "
|
||||||
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
echo "====> : Start importing Wikidata: Wikidata Query Service -> PostgreSQL"
|
||||||
|
echo " : The Wikidata license: CC0 - https://www.wikidata.org/wiki/Wikidata:Main_Page "
|
||||||
|
echo " : Thank you Wikidata Contributors ! "
|
||||||
|
make import-wikidata
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
echo "====> : Testing PostgreSQL tables to match layer definitions metadata"
|
echo "====> : Testing PostgreSQL tables to match layer definitions metadata"
|
||||||
|
@ -276,19 +272,12 @@ echo " : See other MVT tools : https://github.com/mapbox/awesome-vector-til
|
||||||
echo " : "
|
echo " : "
|
||||||
echo " : You will see a lot of deprecated warning in the log! This is normal! "
|
echo " : You will see a lot of deprecated warning in the log! This is normal! "
|
||||||
echo " : like : Mapnik LOG> ... is deprecated and will be removed in Mapnik 4.x ... "
|
echo " : like : Mapnik LOG> ... is deprecated and will be removed in Mapnik 4.x ... "
|
||||||
|
make generate-tiles
|
||||||
docker-compose -f docker-compose.yml -f ./data/docker-compose-config.yml run $DC_OPTS generate-vectortiles
|
|
||||||
|
|
||||||
echo " "
|
|
||||||
echo "-------------------------------------------------------------------------------------"
|
|
||||||
echo "====> : Add special metadata to mbtiles! "
|
|
||||||
docker-compose run $DC_OPTS openmaptiles-tools generate-metadata ./data/tiles.mbtiles
|
|
||||||
docker-compose run $DC_OPTS openmaptiles-tools chmod 666 ./data/tiles.mbtiles
|
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
echo "====> : Stop PostgreSQL service ( but we keep PostgreSQL data volume for debugging )"
|
echo "====> : Stop PostgreSQL service ( but we keep PostgreSQL data volume for debugging )"
|
||||||
docker-compose stop postgres
|
make db-stop
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
|
@ -322,13 +311,6 @@ echo "====> : (disk space) We have created a lot of docker images: "
|
||||||
echo " : Hint: you can remove with: docker rmi IMAGE "
|
echo " : Hint: you can remove with: docker rmi IMAGE "
|
||||||
docker images | grep openmaptiles
|
docker images | grep openmaptiles
|
||||||
|
|
||||||
|
|
||||||
echo " "
|
|
||||||
echo "-------------------------------------------------------------------------------------"
|
|
||||||
echo "====> : (disk space) We have created this new docker volume for PostgreSQL data:"
|
|
||||||
echo " : Hint: you can remove with : docker volume rm openmaptiles_pgdata "
|
|
||||||
docker volume ls -q | grep openmaptiles
|
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo "-------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------"
|
||||||
echo "====> : (disk space) We have created the new vectortiles ( ./data/tiles.mbtiles ) "
|
echo "====> : (disk space) We have created the new vectortiles ( ./data/tiles.mbtiles ) "
|
||||||
|
|