Merge branch 'master' into power_facilities
2
.env
|
@ -4,7 +4,7 @@
|
|||
TILESET_FILE=openmaptiles.yaml
|
||||
|
||||
# Use 3-part patch version to ignore patch updates, e.g. 5.0.0
|
||||
TOOLS_VERSION=6.2
|
||||
TOOLS_VERSION=latest
|
||||
|
||||
# Make sure these values are in sync with the ones in .env-postgres file
|
||||
PGDATABASE=openmaptiles
|
||||
|
|
21
Makefile
|
@ -186,6 +186,7 @@ Hints for developers:
|
|||
make generate-qa # statistics for a given layer's field
|
||||
make generate-tiles-pg # generate vector tiles based on .env settings using PostGIS ST_MVT()
|
||||
make generate-tiles # generate vector tiles based on .env settings using Mapnik (obsolete)
|
||||
make generate-changed-tiles # Generate tiles changed by import-diff
|
||||
make test-sql # run unit tests on the OpenMapTiles SQL schema
|
||||
cat .env # list PG database and MIN_ZOOM and MAX_ZOOM information
|
||||
cat quickstart.log # transcript of the last ./quickstart.sh run
|
||||
|
@ -200,6 +201,7 @@ Hints for downloading & importing data:
|
|||
make download-bbbike area=Amsterdam # download OSM data from bbbike.org and create config file
|
||||
make import-data # Import data from OpenStreetMapData, Natural Earth and OSM Lake Labels.
|
||||
make import-osm # Import OSM data with the mapping rules from build/mapping.yaml
|
||||
make import-diff # Import OSM updates from data/changes.osc.gz
|
||||
make import-wikidata # Import labels from Wikidata
|
||||
make import-sql # Import layers (run this after modifying layer SQL)
|
||||
|
||||
|
@ -397,7 +399,7 @@ import-osm: all start-db-nowait
|
|||
$(DOCKER_COMPOSE) $(DC_CONFIG_CACHE) run $(DC_OPTS_CACHE) openmaptiles-tools sh -c 'pgwait && import-osm $(PBF_FILE)'
|
||||
|
||||
.PHONY: start-update-osm
|
||||
start-update-osm: all start-db
|
||||
start-update-osm: start-db
|
||||
@$(assert_area_is_given)
|
||||
$(DOCKER_COMPOSE) $(DC_CONFIG_CACHE) up -d update-osm
|
||||
|
||||
|
@ -406,7 +408,7 @@ stop-update-osm:
|
|||
$(DOCKER_COMPOSE) stop update-osm
|
||||
|
||||
.PHONY: import-diff
|
||||
import-diff: all start-db-nowait
|
||||
import-diff: start-db-nowait
|
||||
@$(assert_area_is_given)
|
||||
$(DOCKER_COMPOSE) $(DC_CONFIG_CACHE) run $(DC_OPTS_CACHE) openmaptiles-tools sh -c 'pgwait && import-diff'
|
||||
|
||||
|
@ -440,6 +442,21 @@ generate-tiles-pg: all start-db
|
|||
$(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools \
|
||||
mbtiles-tools meta-generate "$(MBTILES_LOCAL_FILE)" $(TILESET_FILE) --auto-minmax --show-ranges
|
||||
|
||||
.PHONY: data/tiles.txt
|
||||
data/tiles.txt:
|
||||
find ./data -name "*.tiles" -exec cat {} \; -exec rm {} \; | \
|
||||
$(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools \
|
||||
tile_multiplier $(MIN_ZOOM) $(MAX_ZOOM) >> data/tiles.txt
|
||||
|
||||
.PHONY: generate-changed-tiles
|
||||
generate-changed-tiles: data/tiles.txt
|
||||
# Re-generating updated tiles, if needed
|
||||
if [ -s data/tiles.txt ] ; then \
|
||||
$(DOCKER_COMPOSE) $(DC_CONFIG_CACHE) run $(DC_OPTS_CACHE) openmaptiles-tools refresh-views; \
|
||||
$(DOCKER_COMPOSE) run $(DC_OPTS) -e LIST_FILE=data/tiles.txt openmaptiles-tools generate-tiles; \
|
||||
rm data/tiles.txt; \
|
||||
fi
|
||||
|
||||
.PHONY: start-tileserver
|
||||
start-tileserver: init-dirs
|
||||
@echo " "
|
||||
|
|
|
@ -162,7 +162,7 @@ make import-data # Import external data from OpenStreetMapData, Natur
|
|||
make download area=albania # download albania .osm.pbf file -- can be skipped if a .osm.pbf file already existing
|
||||
make import-osm # import data into postgres
|
||||
make import-wikidata # import Wikidata
|
||||
make import-sql # create / import sql funtions
|
||||
make import-sql # create / import sql functions
|
||||
make generate-bbox-file # compute data bbox -- not needed for the whole planet
|
||||
make generate-tiles-pg # generate tiles
|
||||
```
|
||||
|
|
84
UPDATE.md
|
@ -10,44 +10,71 @@ or import specific change files.
|
|||
|
||||
### Choosing the Download Source
|
||||
|
||||
While GeoFabrik currently provides extracts of basically all countries, they provide only daily updates.
|
||||
While GeoFabrik currently provides extracts of basically all countries, they provide only daily updates.
|
||||
If you need minutely updates you might want to try openstreetmap.fr, for example like this: `make download-osmfr area=africa/eritrea`, which configures minutely updates.
|
||||
|
||||
### Preparations
|
||||
|
||||
If you plan to keep data updated automatically, before importing any data, make sure to set
|
||||
If you plan to keep data updated automatically, before importing any data, make sure to set
|
||||
|
||||
```
|
||||
DIFF_MODE=true
|
||||
```
|
||||
|
||||
|
||||
in the `.env`
|
||||
|
||||
Now download fresh data:
|
||||
|
||||
```
|
||||
```
|
||||
make download area=your-area-of-choice
|
||||
```
|
||||
|
||||
### Keep Database Updated
|
||||
|
||||
You can use the new imposm3 feature to keep the database updated (thanks to the [work by @stirringhalo](https://github.com/openmaptiles/openmaptiles/pull/131)). This will automatically download
|
||||
the OSM change feed and import it into the database.
|
||||
After each run you should also have a list of tiles that have updated.
|
||||
You can use imposm3 to keep the database updated (thanks to the [work by @stirringhalo](https://github.com/openmaptiles/openmaptiles/pull/131)).
|
||||
This will repeatedly download the OSM change feed and import it into the database.
|
||||
In order to be able to update the database, the initial download and import of the OSM data must be done when `DIFF_MODE=true` is set in the `.env` file.
|
||||
In this mode the initial download also sets the update source and the update intervals.
|
||||
|
||||
To start the update process please use
|
||||
```
|
||||
make update-osm
|
||||
make start-update-osm
|
||||
```
|
||||
|
||||
To stop the update process please use
|
||||
```
|
||||
make stop-update-osm
|
||||
```
|
||||
|
||||
After each update activation, **imposm3** will store lists of updated tiles in text format in subfolders of the `diffdir`,
|
||||
named for the date(s) on which the import took place (`YYYYMMDD`).
|
||||
|
||||
See [Generate Changed Tiles](#generate-changed-tiles) below on how this file can be used.
|
||||
|
||||
#### Note
|
||||
When the update process is actively updating the DB it is impossible to successfully generate tiles,
|
||||
as there will be conflicts and deadlocks related to the DB access.
|
||||
|
||||
Unfortunately, there is no known way to execute an external command in-between rounds of the `update-osm` process.
|
||||
|
||||
#### Troubleshooting
|
||||
|
||||
The log file for osm update can be viewed using
|
||||
|
||||
```
|
||||
docker-compose logs --tail 100 --follow update-osm
|
||||
```
|
||||
|
||||
Use `Ctrl-C` to stop following the log.
|
||||
|
||||
The output will be similar to this:
|
||||
|
||||
```
|
||||
[info] Importing #4889572 including changes till ....... +0000 UTC (1m13s behind)
|
||||
```
|
||||
```
|
||||
[info] Importing #4889572 including changes till ....... +0000 UTC (2h10m10s behind)
|
||||
```
|
||||
|
||||
It might take some time to catch up with the latest changes, but the "time behind" should always decrease. If it doesn't, you need to download a new extract our don't have enough system resources to keep-up with the changes.
|
||||
It might take some time to catch up with the latest changes, but the "time behind" should decrease until it is a few minutes.
|
||||
If it doesn't, you need to download a new extract or check that there are enough system resources to keep-up with the changes.
|
||||
|
||||
Finally you will get an output like this - this indicates, that some 6 objects were changed:
|
||||
|
||||
|
@ -55,7 +82,7 @@ Finally you will get an output like this - this indicates, that some 6 objects w
|
|||
[progress] 3s C: 0/s (0) N: 0/s (0) W: 0/s (6) R: 0/s (0)
|
||||
```
|
||||
|
||||
The process will keep running forever and eventually print something like this - which just means that no changes were in the latest changeset:
|
||||
The process will keep running foreverprint something like this - which just means that no changes were in the latest changeset:
|
||||
|
||||
```
|
||||
[progress] 0s C: 0/s (0) N: 0/s (0) W: 0/s (0) R: 0/s (0)
|
||||
|
@ -63,30 +90,27 @@ The process will keep running forever and eventually print something like this -
|
|||
|
||||
### Import Change File
|
||||
|
||||
Given you have a file `changes.osc.gz` in your import folder. Once you ran the import command you should also have a list of tiles that have updated.
|
||||
You may perform a one-time import of OSM changes from the `changes.osc.gz` file in your import folder using
|
||||
|
||||
```
|
||||
make import-diff
|
||||
```
|
||||
|
||||
Similar to[Keep Database Updated](#keep_database_updated) above, **imposm3** will store the list of updated tiles in text file in subfolders of the `diffdir`,
|
||||
named for the date on which the import took place (`YYYYMMDD`).
|
||||
|
||||
See [Generate Changed Tiles](#generate-changed-tiles) below.
|
||||
|
||||
#### Note
|
||||
There is no `make` command for downloading OSM changes into `changes.osc.gz`.
|
||||
You may perform this task using [`osmupdate`](https://wiki.openstreetmap.org/wiki/Osmupdate),
|
||||
[pyosmium-get-changes](https://docs.osmcode.org/pyosmium/latest/tools_get_changes.html),
|
||||
or downloading the changefile directly from the replication server.
|
||||
|
||||
## Generate Changed Tiles
|
||||
|
||||
After the import has finished **imposm3** will store lists of tiles in text format in subfolders of the `diffdir`,
|
||||
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:
|
||||
To generate all changed tiles, based on the lists of all updated tiles, and update the existing MBtiles file, please use
|
||||
|
||||
```
|
||||
cd data && sort ./*/*.tiles | uniq > tiles.txt
|
||||
```
|
||||
|
||||
After generating the tiles.txt you might and to delete the `*.tiles` files to not include them in the next run:
|
||||
|
||||
```
|
||||
cd data && rm ./*/*.tiles
|
||||
```
|
||||
|
||||
Finally run the command to read the tilelist and write the updated vector tiles in the existing MBtiles file.
|
||||
|
||||
```
|
||||
docker-compose run generate-changed-vectortiles
|
||||
make generate-changed-tiles
|
||||
```
|
||||
|
|
|
@ -2,7 +2,11 @@ layer:
|
|||
id: "landcover"
|
||||
requires:
|
||||
tables:
|
||||
- ne_10m_antarctic_ice_shelves_polys
|
||||
- ne_10m_glaciated_areas
|
||||
- ne_50m_antarctic_ice_shelves_polys
|
||||
- ne_50m_glaciated_areas
|
||||
- ne_110m_glaciated_areas
|
||||
description: |
|
||||
Landcover is used to describe the physical material at the surface of the earth. At lower zoom levels this is
|
||||
from Natural Earth data for glaciers and ice shelves and at higher zoom levels the landcover is [implied by OSM tags](http://wiki.openstreetmap.org/wiki/Landcover). The most common use case for this layer
|
||||
|
@ -22,7 +26,7 @@ layer:
|
|||
rock:
|
||||
subclass: ['bare_rock', 'scree']
|
||||
grass:
|
||||
subclass: ['fell', 'grassland', 'heath', 'scrub', 'tundra', 'grass', 'meadow', 'allotments', 'park', 'village_green', 'recreation_ground', 'garden', 'golf_course']
|
||||
subclass: ['fell', 'grassland', 'heath', 'scrub', 'shrubbery', '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:
|
||||
|
@ -42,6 +46,7 @@ layer:
|
|||
- bog
|
||||
- dune
|
||||
- scrub
|
||||
- shrubbery
|
||||
- farm
|
||||
- farmland
|
||||
- fell
|
||||
|
|
|
@ -33,6 +33,7 @@ tables:
|
|||
- grassland
|
||||
- heath
|
||||
- scrub
|
||||
- shrubbery
|
||||
- tundra
|
||||
- glacier
|
||||
- bare_rock
|
||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 65 KiB Po Szerokość: | Wysokość: | Rozmiar: 67 KiB |
|
@ -1,5 +1,8 @@
|
|||
layer:
|
||||
id: "mountain_peak"
|
||||
requires:
|
||||
tables:
|
||||
- ne_10m_admin_0_countries
|
||||
description: |
|
||||
[Natural peaks](http://wiki.openstreetmap.org/wiki/Tag:natural%3Dpeak)
|
||||
buffer_size: 64
|
||||
|
|
|
@ -2,8 +2,8 @@ CREATE OR REPLACE FUNCTION normalize_capital_level(capital text)
|
|||
RETURNS int AS
|
||||
$$
|
||||
SELECT CASE
|
||||
WHEN capital IN ('yes', '2') THEN 2
|
||||
WHEN capital = '4' THEN 4
|
||||
WHEN capital = 'yes' THEN 2
|
||||
WHEN capital IN ('2', '3', '4', '5', '6') THEN capital::int
|
||||
END;
|
||||
$$ LANGUAGE SQL IMMUTABLE
|
||||
STRICT
|
||||
|
|
|
@ -4,7 +4,7 @@ layer:
|
|||
tables:
|
||||
- ne_10m_admin_1_states_provinces
|
||||
- ne_10m_admin_0_countries
|
||||
- ne_10m_admin_1_states_provinces
|
||||
- ne_10m_populated_places
|
||||
description: |
|
||||
The place layer consists out of [countries](http://wiki.openstreetmap.org/wiki/Tag:place%3Dcountry),
|
||||
[states](http://wiki.openstreetmap.org/wiki/Tag:place%3Dstate), [cities](http://wiki.openstreetmap.org/wiki/Key:place)
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
DO
|
||||
$$
|
||||
BEGIN
|
||||
IF NOT EXISTS(SELECT 1 FROM pg_type WHERE typname = 'city_place') THEN
|
||||
PERFORM 'city_place'::regtype;
|
||||
EXCEPTION
|
||||
WHEN undefined_object THEN
|
||||
CREATE TYPE city_place AS enum ('city', 'town', 'village', 'hamlet', 'suburb', 'quarter', 'neighbourhood', 'isolated_dwelling');
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ $$
|
|||
LEFT JOIN ne_10m_populated_places AS ne ON
|
||||
(
|
||||
(osm.tags ? 'wikidata' AND osm.tags->'wikidata' = ne.wikidataid) OR
|
||||
lower(osm.name) IN (lower(ne.name), lower(ne.namealt), lower(ne.meganame), lower(ne.gn_ascii), lower(ne.nameascii)) OR
|
||||
lower(osm.name_en) IN (lower(ne.name), lower(ne.namealt), lower(ne.meganame), lower(ne.gn_ascii), lower(ne.nameascii)) OR
|
||||
lower(osm.name) IN (lower(ne.name), lower(ne.namealt), lower(ne.meganame), lower(ne.name_en), lower(ne.nameascii)) OR
|
||||
lower(osm.name_en) IN (lower(ne.name), lower(ne.namealt), lower(ne.meganame), lower(ne.name_en), lower(ne.nameascii)) OR
|
||||
ne.name = unaccent(osm.name)
|
||||
)
|
||||
AND osm.place IN ('city', 'town', 'village')
|
||||
|
|
|
@ -44,6 +44,7 @@ def_poi_mapping_amenity: &poi_mapping_amenity
|
|||
- pharmacy
|
||||
- place_of_worship
|
||||
- police
|
||||
- parcel_locker
|
||||
- post_box
|
||||
- post_office
|
||||
- prison
|
||||
|
@ -353,6 +354,9 @@ def_poi_fields: &poi_fields
|
|||
- name: uic_ref
|
||||
key: uic_ref
|
||||
type: string
|
||||
- name: ref
|
||||
key: ref
|
||||
type: string
|
||||
- name: religion
|
||||
key: religion
|
||||
type: string
|
||||
|
@ -374,6 +378,9 @@ def_poi_fields: &poi_fields
|
|||
- name: network
|
||||
key: network
|
||||
type: string
|
||||
- name: brand
|
||||
key: brand
|
||||
type: string
|
||||
|
||||
def_poi_mapping: &poi_mapping
|
||||
aerialway: *poi_mapping_aerialway
|
||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 1.4 MiB Po Szerokość: | Wysokość: | Rozmiar: 1.4 MiB |
|
@ -61,7 +61,7 @@ layer:
|
|||
ice_cream:
|
||||
subclass: ['chocolate', 'confectionery']
|
||||
post:
|
||||
subclass: ['post_box', 'post_office']
|
||||
subclass: ['post_box', 'post_office', 'parcel_locker']
|
||||
cafe:
|
||||
subclass: ['cafe']
|
||||
school:
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
DO
|
||||
$$
|
||||
BEGIN
|
||||
IF NOT EXISTS(SELECT 1
|
||||
FROM pg_type
|
||||
WHERE typname = 'public_transport_stop_type') THEN
|
||||
PERFORM 'public_transport_stop_type'::regtype;
|
||||
EXCEPTION
|
||||
WHEN undefined_object THEN
|
||||
CREATE TYPE public_transport_stop_type AS enum (
|
||||
'subway', 'tram_stop', 'bus_station', 'bus_stop'
|
||||
);
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
|
|
|
@ -27,6 +27,18 @@ BEGIN
|
|||
AND name = ''
|
||||
AND COALESCE(tags -> 'operator', tags -> 'network') IS NOT NULL;
|
||||
|
||||
-- Parcel locker without name
|
||||
-- use either brand or operator and add ref if present
|
||||
-- (using name for parcel lockers is discouraged, see osm wiki)
|
||||
UPDATE osm_poi_point
|
||||
SET (name, tags) = (
|
||||
CONCAT(COALESCE(tags -> 'brand', tags -> 'operator'), concat(' ', tags -> 'ref')),
|
||||
tags || hstore('name', CONCAT(COALESCE(tags -> 'brand', tags -> 'operator'), concat(' ', tags -> 'ref')))
|
||||
)
|
||||
WHERE subclass = 'parcel_locker'
|
||||
AND name = ''
|
||||
AND COALESCE(tags -> 'brand', tags -> 'operator') IS NOT NULL;
|
||||
|
||||
UPDATE osm_poi_point
|
||||
SET tags = update_tags(tags, geometry)
|
||||
WHERE COALESCE(tags->'name:latin', tags->'name:nonlatin', tags->'name_int') IS NULL
|
||||
|
|
|
@ -67,7 +67,7 @@ SELECT CASE
|
|||
'motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'raceway',
|
||||
'motorway_construction', 'trunk_construction', 'primary_construction',
|
||||
'secondary_construction', 'tertiary_construction', 'raceway_construction',
|
||||
'busway'
|
||||
'busway', 'bus_guideway'
|
||||
) THEN TRUE --includes ramps
|
||||
ELSE FALSE
|
||||
END
|
||||
|
|
|
@ -45,7 +45,7 @@ generalized_tables:
|
|||
# etldoc: osm_highway_linestring -> osm_highway_linestring_gen_z11
|
||||
highway_linestring_gen_z11:
|
||||
source: highway_linestring
|
||||
sql_filter: (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', 'busway') OR highway = 'construction' AND construction IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', 'busway')) AND NOT is_area AND ST_IsValid(geometry)
|
||||
sql_filter: (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', 'busway', 'bus_guideway') OR highway = 'construction' AND construction IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', 'busway', 'bus_guideway')) AND NOT is_area AND ST_IsValid(geometry)
|
||||
tolerance: ZRES12
|
||||
|
||||
name_field: &name
|
||||
|
@ -238,6 +238,7 @@ tables:
|
|||
- track
|
||||
- raceway
|
||||
- busway
|
||||
- bus_guideway
|
||||
- construction
|
||||
public_transport:
|
||||
- platform
|
||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 157 KiB Po Szerokość: | Wysokość: | Rozmiar: 159 KiB |
|
@ -10,13 +10,14 @@ DROP TRIGGER IF EXISTS trigger_refresh_name ON transportation_name.updates_name;
|
|||
DO
|
||||
$$
|
||||
BEGIN
|
||||
IF NOT EXISTS(SELECT 1 FROM pg_type WHERE typname = 'route_network_type') THEN
|
||||
PERFORM 'route_network_type'::regtype;
|
||||
EXCEPTION
|
||||
WHEN undefined_object THEN
|
||||
CREATE TYPE route_network_type AS enum (
|
||||
'us-interstate', 'us-highway', 'us-state',
|
||||
'ca-transcanada',
|
||||
'gb-motorway', 'gb-trunk'
|
||||
);
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ layer:
|
|||
highway: raceway
|
||||
busway:
|
||||
highway: busway
|
||||
bus_guideway:
|
||||
highway: bus_guideway
|
||||
motorway_construction:
|
||||
__AND__:
|
||||
highway: construction
|
||||
|
|
|
@ -165,8 +165,8 @@ BEGIN
|
|||
layer
|
||||
FROM osm_transportation_merge_linestring_gen_z11
|
||||
WHERE (update_id IS NULL OR id = update_id)
|
||||
AND highway NOT IN ('tertiary', 'tertiary_link', 'busway')
|
||||
AND construction NOT IN ('tertiary', 'tertiary_link', 'busway')
|
||||
AND highway NOT IN ('tertiary', 'tertiary_link', 'busway', 'bus_guideway')
|
||||
AND construction NOT IN ('tertiary', 'tertiary_link', 'busway', 'bus_guideway')
|
||||
;
|
||||
|
||||
DELETE FROM osm_transportation_merge_linestring_gen_z9
|
||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 157 KiB Po Szerokość: | Wysokość: | Rozmiar: 159 KiB |
|
@ -101,7 +101,6 @@ tables:
|
|||
- bay
|
||||
- spring
|
||||
waterway:
|
||||
- riverbank
|
||||
- dock
|
||||
water:
|
||||
- river
|
||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 38 KiB Po Szerokość: | Wysokość: | Rozmiar: 36 KiB |
|
@ -1,7 +1,6 @@
|
|||
CREATE OR REPLACE FUNCTION water_class(waterway text, water text, leisure text) RETURNS text AS
|
||||
$$
|
||||
SELECT CASE
|
||||
WHEN waterway='riverbank' THEN 'river'
|
||||
%%FIELD_MAPPING: class %%
|
||||
ELSE 'lake'
|
||||
END;
|
||||
|
@ -19,18 +18,6 @@ $$ LANGUAGE SQL IMMUTABLE
|
|||
STRICT
|
||||
PARALLEL SAFE;
|
||||
|
||||
-- Add ne_id for missing ne_50m_lakes.
|
||||
UPDATE ne_50m_lakes SET ne_id = ne_10m_lakes.ne_id
|
||||
FROM ne_50m_lakes lakes
|
||||
LEFT JOIN ne_10m_lakes USING (wikidataid)
|
||||
WHERE ne_50m_lakes.wikidataid = ne_10m_lakes.wikidataid
|
||||
AND ne_50m_lakes.ne_id = 0;
|
||||
|
||||
-- Update ne_110_lakes ne_id where two lakes (Lake Onega) have identical attributes.
|
||||
-- New ne_id is taken from ne_50m_lakes
|
||||
UPDATE ne_110m_lakes SET ne_id = 1159126421
|
||||
WHERE ne_id = 1159113251
|
||||
AND ST_Area(geometry) < 10000000000;
|
||||
|
||||
-- Get matching osm id for natural earth id.
|
||||
DROP MATERIALIZED VIEW IF EXISTS match_osm_ne_id CASCADE;
|
||||
|
|
|
@ -2,6 +2,12 @@ layer:
|
|||
id: "water"
|
||||
requires:
|
||||
tables:
|
||||
- ne_10m_lakes
|
||||
- ne_10m_ocean
|
||||
- ne_110m_lakes
|
||||
- ne_110m_ocean
|
||||
- ne_50m_lakes
|
||||
- ne_50m_ocean
|
||||
- osm_ocean_polygon
|
||||
description: |
|
||||
Water polygons representing oceans and lakes. Covered watered areas are excluded (`covered=yes`).
|
||||
|
@ -19,8 +25,7 @@ layer:
|
|||
class:
|
||||
description: |
|
||||
All water polygons from [OpenStreetMapData](http://osmdata.openstreetmap.de/) have the class `ocean`.
|
||||
Water bodies with the [`waterway=riverbank`](http://wiki.openstreetmap.org/wiki/Tag:waterway=riverbank)
|
||||
or [`water=river`](http://wiki.openstreetmap.org/wiki/Tag:water=river) tag are classified as river. Wet and dry docks
|
||||
Water bodies with the [`water=river`](http://wiki.openstreetmap.org/wiki/Tag:water=river) tag are classified as river. Wet and dry docks
|
||||
tagged [`waterway=dock`](http://wiki.openstreetmap.org/wiki/Tag:waterway=dock) are classified as a `dock`.
|
||||
Swimming pools tagged [`leisure=swimming_pool`](https://wiki.openstreetmap.org/wiki/Tag:leisure=swimming_pool) are classified as a `swimming_pool`
|
||||
All other water bodies are classified as `lake`.
|
||||
|
@ -29,7 +34,6 @@ layer:
|
|||
waterway: 'dock'
|
||||
river:
|
||||
water: 'river'
|
||||
waterway: 'riverbank'
|
||||
lake:
|
||||
ocean:
|
||||
swimming_pool:
|
||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 43 KiB Po Szerokość: | Wysokość: | Rozmiar: 41 KiB |
|
@ -4,6 +4,9 @@ layer:
|
|||
requires:
|
||||
layers:
|
||||
- water
|
||||
tables:
|
||||
- ne_110m_rivers_lake_centerlines
|
||||
- ne_50m_rivers_lake_centerlines
|
||||
description: |
|
||||
OpenStreetMap [waterways](https://wiki.openstreetmap.org/wiki/Waterways) for higher zoom levels (z9 and more)
|
||||
and Natural Earth rivers and lake centerlines for low zoom levels (z3 - z8).
|
||||
|
|
|
@ -13,4 +13,19 @@
|
|||
<tag k="amenity" v="atm"/>
|
||||
<tag k="network" v="OpenMapTiles ATM"/>
|
||||
</node>
|
||||
<node id="600004" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.5" lon="-80.5">
|
||||
<tag k="amenity" v="parcel_locker"/>
|
||||
<tag k="name" v="OpenMapTiles Parcel Locker"/>
|
||||
<tag k="brand" v="Different operator"/>
|
||||
<tag k="ref" v="PL001"/>
|
||||
</node>
|
||||
<node id="600005" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.6" lon="-80.6">
|
||||
<tag k="amenity" v="parcel_locker"/>
|
||||
<tag k="brand" v="OpenMapTiles Parcel Locker"/>
|
||||
<tag k="ref" v="PL002"/>
|
||||
</node>
|
||||
<node id="600006" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.7" lon="-80.7">
|
||||
<tag k="amenity" v="parcel_locker"/>
|
||||
<tag k="operator" v="OpenMapTiles Parcel Locker"/>
|
||||
</node>
|
||||
</osm>
|
||||
|
|
|
@ -170,6 +170,20 @@ BEGIN
|
|||
INSERT INTO omt_test_failures VALUES(600, 'import', 'osm_poi_point atm with name "OpenMapTiles ATM" expected 3, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
-- verify that parcel lockers are imported with correct name which can come from tags like brand or operator and can contain ref
|
||||
SELECT COUNT(*) INTO cnt FROM osm_poi_point
|
||||
WHERE subclass = 'parcel_locker'
|
||||
AND tags->'name' like 'OpenMapTiles Parcel Locker%';
|
||||
IF cnt <> 3 THEN
|
||||
INSERT INTO omt_test_failures VALUES(600, 'import', 'osm_poi_point parcel_locker with name like "OpenMapTiles Parcel Locker%" expected 3, got ' || cnt);
|
||||
END IF;
|
||||
SELECT COUNT(*) INTO cnt FROM osm_poi_point
|
||||
WHERE subclass = 'parcel_locker'
|
||||
AND tags->'name' like 'OpenMapTiles Parcel Locker PL00%';
|
||||
IF cnt <> 1 THEN
|
||||
INSERT INTO omt_test_failures VALUES(600, 'import', 'osm_poi_point parcel_locker with name like "OpenMapTiles Parcel Locker PL00%" expected 1, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
END;
|
||||
|
||||
$$
|
||||
|
|
|
@ -79,6 +79,7 @@ BEGIN
|
|||
-- Test 600
|
||||
|
||||
-- check if name was applied correctly
|
||||
-- for atm
|
||||
SELECT COUNT(*) INTO cnt FROM osm_poi_point
|
||||
WHERE subclass = 'atm'
|
||||
AND tags->'name' = 'OpenMapTiles ATM';
|
||||
|
@ -91,6 +92,20 @@ BEGIN
|
|||
IF cnt <> 1 THEN
|
||||
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point atm with name "New name" expected 1, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
-- for parcel_locker
|
||||
SELECT COUNT(*) INTO cnt FROM osm_poi_point
|
||||
WHERE subclass = 'parcel_locker'
|
||||
AND tags->'name' like 'OpenMapTiles Parcel Locker%';
|
||||
IF cnt <> 2 THEN
|
||||
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point atm with name "OpenMapTiles ATM" expected 2, got ' || cnt);
|
||||
END IF;
|
||||
SELECT COUNT(*) INTO cnt FROM osm_poi_point
|
||||
WHERE subclass = 'parcel_locker'
|
||||
AND tags->'name' = 'Different operator PL001';
|
||||
IF cnt <> 1 THEN
|
||||
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point parcel_locker with name "Different operator PL001" expected 1, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
END;
|
||||
|
||||
|
|
|
@ -3,11 +3,17 @@
|
|||
<!--
|
||||
Test 600: POIs
|
||||
Change atm's network
|
||||
Remove Parcel locker name and leave brand
|
||||
-->
|
||||
<modify>
|
||||
<node id="600003" visible="true" timestamp="2020-01-02T00:00:00Z" version="1" lat="35.4" lon="-80.4">
|
||||
<tag k="amenity" v="atm"/>
|
||||
<tag k="network" v="New name"/>
|
||||
</node>
|
||||
<node id="600004" visible="true" timestamp="2020-01-02T00:00:00Z" version="1" lat="35.4" lon="-80.4">
|
||||
<tag k="amenity" v="parcel_locker"/>
|
||||
<tag k="brand" v="Different operator"/>
|
||||
<tag k="ref" v="PL001"/>
|
||||
</node>
|
||||
</modify>
|
||||
</osmChange>
|
||||
|
|