Wykres commitów

644 Commity (2e04f831664eb303e98354bb9dba0ed2511dc998)

Autor SHA1 Wiadomość Data
Adam Laža 2e04f83166
Fix paths and tracks in transportation layer z12 and z13 (#1334)
This PR fixes a bug that causes that `track` lines disappear at z13. This bug was introduced in https://github.com/openmaptiles/openmaptiles/pull/1190, which adds rendering of paths and tracks at z12 and z13.

Before this PR:
z12: lines with `route_rank = 1` are added (no matter what `highway`).
z13: lines with `route_rank BETWEEN 1 AND 2` and `highway = 'path'` are added.
-> tracks with `route_rank=1` are added at z12 but not at z13.

After this PR
z12: lines with `route_rank = 1` and `highway IN ('path', 'track')` are added.
z13: lines with `route_rank BETWEEN 1 AND 2` and `highway IN ('path', 'track')` are added .
-> only tracks and paths are added at z12 and z13 (which was IMHO the goal of https://github.com/openmaptiles/openmaptiles/pull/1190)

* Add only the most important paths and tracks (route_rank=1) to z12 and more important ones (route_rank between 1-2 or sac_scale or has name) to z13.
2022-01-05 07:28:34 +01:00
Tomas Pohanka 73dcd23497
Run get_basic_name after osml10n_street_abbrev_* (#1326)
PR move `get_basic_names(tags, geometry)` function from `transportation_name_tags` function and adding it after `transportation_name_tags` resolve street abbrevation.

PR runs through `test-sql` test without error. Adding to `osm_transportation_name_network` (table and for update) was done in consequence of `test-sql` errors ([update test 500](a747d98550/tests/test-post-update.sql (L53))). Originally `get_basic_names` was just in `osm_transportation_name_linestring` table.

FIX #1324

![seattle_fix](https://user-images.githubusercontent.com/5182210/145085141-7857e97e-9b83-4467-bb98-84cc4a2e0623.png)
2021-12-08 08:20:15 +01:00
Tomas Pohanka 44ae83718c
Remove `STRICT` statement (#1320)
Remove `STRICT` statement from `transportation_name_tags` function.

Concurrently with remove `STRICT` from `get_basic_names` and `get_latin_name` in OMT-T

FIX #1319
2021-12-07 17:59:04 +01:00
Nicholas Skehin 207396269e
Implement aerialway labels (#1309)
This PR adds labels to `aerialway` linestrings after zoom level 12. I roughly followed PR https://github.com/openmaptiles/openmaptiles/pull/1179

These are useful in ski resorts and should not inflate the size of the tiles by much as aerialways are rare:
![Screenshot from 2021-11-18 12-18-58](https://user-images.githubusercontent.com/632493/142680225-1875904b-d146-4932-8a22-8c36919b875d.png)


Co-authored-by: Tomas Pohanka <TomPohys@gmail.com>
2021-11-26 10:16:41 +01:00
Brian Sperlongano 7f23feab88
Add expressway tagging to the transportation layer (#1313)
Fixes #1148 

This PR adds expressway tagging to the `transportation` layer, by setting `expressway=1` for non-motorway roads tagged `expressway=yes`, and omitting the tag otherwise.  Additionally, I've added a few unit tests to verify that the expressway tagging is being imported and updated into the intermediate tables.

Here is an example of expressway tagging on US-1 in Rhode Island, USA:

![image](https://user-images.githubusercontent.com/3254090/143501278-db3671b2-2efa-4998-bffd-9ddfec63579b.png)
2021-11-26 07:55:20 +01:00
Brian Sperlongano ec74480414
BUGFIX: Fix name-based way fragmentation in transportation_name (#1295)
I discovered this bug while investigating issues with the updates process related to #1190 #1292, and #814.

The `transportation_name` layer produces slightly different `tags` hstore values in the `osm_transportation_name_linestring` table during the initial import versus when running an update.  As currently written, the import code produces null-value keys in the `tags` column, while the update code suppresses them.  This PR removes that difference and makes the import code use same method that is currently used in the update code.

With a test case I've written, the import code produces a tags hstore that looks like this:
`"name"=>"OpenMapTiles Secondary 2", "name:de"=>NULL, "name:en"=>NULL, "name_int"=>"OpenMapTiles Secondary 2", "name:latin"=>"OpenMapTiles Secondary 2"`

...while the update code produces a tags hstore that looks like this:

`"name"=>"OpenMapTiles Secondary 2", "name_int"=>"OpenMapTiles Secondary 2", "name:latin"=>"OpenMapTiles Secondary 2"`

Note the missing NULL values.

This bug causes a small amount of space wastage after an update is run, because the update matching code detects the `tags` value as different, resulting in a duplicate copy of the tags value if that row is updated.  This causes duplicate objects and breaks GROUP BY clauses that expect to group same-tagged features together.  I've tested this by inspection of a generated mbtiles, database spot checks, and the unit test code included in this PR.
2021-11-25 10:45:11 +01:00
Brian Sperlongano 0cff3449b5
Implement non-blocking refresh (#1308)
This PR implements non-blocking updates in the park layer.

The approach was to use the `REFRESH MATERIALIZED VIEW CONCURRENTLY` feature in postgres.  In order to achieve this, a unique index was added on the z4 dissolved park area table.  The `ST_Union` / `ST_Dump` sequence was changed to an explicit cluster DB scan (an equivalent operation) so that a unique osm ID could be generated from each dissolved polygon.

Below is a screen shot from Idaho, USA showing that the dissolved z4 still works as expected.

![image](https://user-images.githubusercontent.com/3254090/142341513-588045f0-7757-4acd-99e5-a50bbe6b0682.png)
2021-11-24 11:17:29 +01:00
Brian Sperlongano cdff735be1
Remove blank name tags (#1307)
This PR performs the same fix on the park layer that #1268 applied to the waterway layer.  It removes blank name, name_en, and name_de from the tiles.
2021-11-18 18:27:19 +01:00
Eva Jelinkova 054d3a7e4d
add province, increase scalerank + labelrank (#1306)
Add `province` (next to `state`) tag into `osm_state_point`
2021-11-18 18:05:02 +01:00
Brian Sperlongano 75d8c80228
Selective rendering of tracks and paths at z12-13 (#1190)
Closes #271

This PR adds track and path rendering at lower zooms than currently provided, and also achieves near-parity with openstreetmap-carto on track and path rendering. A previously-abandoned attempt, with significant discussion, was #1169.
2021-11-18 17:35:34 +01:00
Eva Jelinkova 93d57a8d03
adding customary_ft for peaks in US (#1298)
Add tagging that will mark unit that is customary in the country. US peaks will include the tag `customary_ft=1`.
2021-11-15 16:55:35 +01:00
Eva Jelinkova 26cfe69a9c
Waterway zoomlevel 6 - 8 corresponding with water (#1291)
This PR is solving https://github.com/openmaptiles/openmaptiles/issues/406, partially also https://github.com/openmaptiles/openmaptiles/issues/320.
It is changing source of data for zoomlevel 6 - 8 in `waterway` layer to OSM (relation `waterway = river`), this way it corresponds with `water` layer.
Testing on Europe, z0 - z9 tiles increase size from 20.7 MB to 21.4 MB. We can discuss the level of generalization, but I think this size change is not critical.
2021-11-10 20:26:14 +01:00
zstadler 1be440404b
Update etl diagram for poi layer (#1297)
Add the missing `osm_poi_stop_centroid` and `osm_poi_stop_rank` materialized views.
2021-11-10 19:49:18 +01:00
Falke Design ebeafc65fa
Add requires.tables to <layer>.yaml (#1236)
**NOTE** this can only be merged after the next tools version is released.

Added required Postgres tables to the `<layer>.yaml` definition.
Close: #1220

PR of tools: https://github.com/openmaptiles/openmaptiles-tools/pull/370
2021-11-05 10:04:54 +01:00
zstadler 5b2e43497e
`transportation_name` update to consider `tags` (#1289)
Following 8bb77b67a1 (r59190611)
2021-11-04 13:51:28 +01:00
Brian Sperlongano 79f8db03f9
Fix blank names (#1268)
This PR fixes a bug in the `waterway` layer in which empty `name_en` and `name_de` tags were being added to the tiles.

`name_en` and `name_de` are legacy tags, intended to be removed in v4.0.  Thus, any legacy consumers that have not yet transitioned to `name:en` and `name:de` etc are currently NOT rendering labels for these features when `name:en` and `name:de` are not tagged on the feature.  Therefore there are two possible approaches:

1.  Remove these tags which are not rendering anyways from the tile, which keeps the bug in place, but shouldn't matter because no data consumer has taken notice of the issue (it would probably be easier to migrate to the new tag than to post a bug report!), _and they're going to be removed eventually anyways_.  That's the approach in this PR.
2021-11-01 09:05:01 +01:00
Brian Sperlongano c7e7fae9ee
Add support for Bus Rapid Transit (highway=busway) (#1271)
This PR adds support for bus rapid transit (BRT) systems, mapped with the [approved tag](https://wiki.openstreetmap.org/wiki/Proposed_features/Tag:highway%3Dbusway) `highway=busway`. BRT systems commonly appear in maps that also show light rail.  Below are two examples of BRT in such maps.

![image (1)](https://user-images.githubusercontent.com/3254090/138018375-ac1f60c3-8059-4f95-bf1d-a659ca0c0103.png)
![image](https://user-images.githubusercontent.com/3254090/138018376-f809aeb3-17ba-495e-b33c-9fe54a0fa840.png)

Since BRT is equivalent in nature to light rail systems, this PR matches the zoom level of light rail, which is rendered at zoom 11+.  BRT systems are relatively uncommon, so adding this support should have negligible impact on tile size.

Below is a data rendering of [a BRT system](https://www.openstreetmap.org/relation/4051383#map=12/40.4068/-79.8646) in Pittsburgh, Pennsylvania.

![image](https://user-images.githubusercontent.com/3254090/138021552-ce974f2f-cfbd-42a0-9848-42ed44da453e.png)
2021-11-01 08:40:07 +01:00
Brian Sperlongano a0d915942a
Allow oneway=-1,1 only (#1267)
This PR removes cases of `oneway=0` as this is an assumed default.  It is not necessary to have this tag on every road or path and by removing it we can save space in the tiles by only including the meaningful values.  It leaves intact `oneway=1` and `oneway=-1`, the latter of which indicates a oneway in the opposite direction of the way.

Unblocks #1265
2021-10-28 15:39:34 +02:00
Brian Sperlongano cded42349f
Remove unnecessary ramp tagging (#1266)
This PR removes unnecessary `ramp` tagging from the `transportation` layer.  The `ramp` tag is used for two situations.  First, it is set for all `highway=***_link` tags to indicate a highway ramp.  The second situation is when the `ramp` tag is set on a highway object, which indicates the presence of a ramp, such as one that would be used for a wheelchair.  `ramp=0` is a reasonable default in these situations; by removing cases of `ramp=0` and presenting only `ramp=1` to the tiles, we can save considerable size in the tiles.  Additionally, there appears to be a bug in which all objects tagged `highway=steps` are inexplicably tagged `ramp=1`.

The changes as follows:

1. Remove `ramp=0` where it appears in the tile.
2. `highway=steps` no longer assumes `ramp=1` in cases where `ramp=*` is not explicitly set.

In the current behavior, `ramp=0` is tagged only in at z13+ but suppressed in lower zooms:
![image](https://user-images.githubusercontent.com/3254090/137589213-5a3432df-8c19-47bf-b556-7be15479790c.png)
![image](https://user-images.githubusercontent.com/3254090/137589296-f3126264-fb07-4346-ba70-c1f1b007a709.png)
![image](https://user-images.githubusercontent.com/3254090/137589306-30f9821b-3160-4b45-98b3-f2b8a0ae3a13.png)

This PR unifies `ramp=0` suppression between z13+ and z12-.
2021-10-28 15:08:56 +02:00
Brian Sperlongano 5833e8ce6e
Suppress rendering of underground buildings (#1241)
This PR does the following:
1. Suppresses underground buildings from rendering, when such buildings are tagged `location=underground`.  Based on the wiki documentation, the `layer` tag does not determine whether a feature is above of below ground.
2. Unifies the building and building relation imposm exclusion mappings.

The following underground building feature in Luxembourg is used as the test object:
https://www.openstreetmap.org/way/582873794
2021-10-28 13:09:06 +02:00
Brian Sperlongano 9e74fb6299
Fix park layer ETL diagram (#1278)
This PR fixes an ETL diagram documentation error in the park layer.
2021-10-25 08:12:17 -04:00
Brian Sperlongano 829f28d27b
Fix logic error in transportation layer filter (#1270)
This PR fixes a bug in the `WHERE` clauses in the transportation layer generalization tables for zoom 10.    The intended behavior of the layer is to suppress `highway=tertiary` and `highway=tertiary_link` at zoom 10 and lower.  However, due to this bug, these objects were not suppressed as intended, because an `OR` was used in the SQL where an `AND` was needed instead.

This bug was inadvertently introduced in #1172 😞
2021-10-19 10:31:51 -04:00
Brian Sperlongano f744f9c009
Upgrade to omt-tools v6, Imposm 0.11.1 and migrate SQL (#1246)
This PR migrates the SQL in the transportation and transportation_name layer to use the new imposm3 mappings which now map a separate primary key ID.
2021-10-14 11:38:28 -04:00
Brian Sperlongano aaa68048d9
Remove unneeded toll code (#1262)
This PR removes unneeded `CASE` clauses which converts `toll` tags to booleans.  However, the `toll` tag is already mapped as a boolean by imposm, therefore this processing can be simplified.
2021-10-13 20:43:14 +02:00
Matt Riggott 4d6945b935
Simplify landcover layer generalisation SQL (#1255)
I was reading through the SQL used to generalise the landcover layer ([`layers/landcover/generalized.sql`](596f44aa26/layers/landcover/generalized.sql)) and I noticed that when creating the generalised landcover tables for zooms 9-13, the SQL was doing something like this:

```sql
SELECT * FROM simplify_vw_z13 WHERE ST_NPoints(geometry) < 50
UNION ALL
SELECT * FROM simplify_vw_z13 WHERE ST_NPoints(geometry) >= 50 AND ST_NPoints(geometry) < 300
```

As in, the simplification/clustering of landcover generalisations was being done in two steps: once for polygons with fewer than fifty points, and once for polygons with 50+ points.

As far as I can see, there's no benefit to doing this — it's probably just an artefact of the dev work done for the [original pull request](https://github.com/openmaptiles/openmaptiles/pull/1035). Of course, I might be completely missing the reason for clustering polygons into two groups (<50 points and 50+ points). But assuming I haven't, I've created this pull request to simplify the SQL used in the generalisation, merging the two steps into something like this:

```sql
SELECT * FROM simplify_vw_z13 WHERE ST_NPoints(geometry) < 300
```

The effect is to slightly reduce the number of landcover features (polygons with <50 points can now be clustered/unioned with those 50+), and to reduce the time taken to generalise the landcover tables (in a small test using OSM's Iceland data I saw a 7% reduction in the time spent). It doesn't alter the features that are shown on the map.

Builds upon work from commits 4a1b0afa26 and da689f9e42.
2021-10-08 08:51:20 +02:00
Brian Sperlongano 91c6d3bbd1
Update ETL docs on landcover layer (#1258)
While reviewing #1255, it became apparent that the ETL documentation for the landcover layer was incomplete.  This PR updates the ETL documentation in `generalized.sql` so that each table has a node in the ETL diagram.
2021-10-07 15:54:13 -04:00
Brian Sperlongano 718e79a704
Fix park polygon update SQL (#1248)
This PR fixes a bug in the park polygon update code introduced in #1160.  Because park polygons at zoom 4 are dissolved, the centroid is not present in the table at that layer.  Thus, a separate update trigger is needed to avoid errors.  This PR adds the separate trigger for the zoom 4 park layer.

This PR likely resolves an unidentified blocker for #1245
2021-09-29 13:40:16 +02:00
Brian Sperlongano b4b897999d
Replace osmborder with imposm/SQL (#1213)
Fixes #1156
Fixes #810
Fixes #1228

This PR replaces `osmborder`, which is no longer maintained, with `imposm` mappings and SQL code to generate borders.  Key features that were moved into the imposm/SQL layer:
1. Grouping by `osm_id` and aggregating by lowest `admin_level` value so that there's only one copy of ways that are members of multiple relations.
2. Filtering out of point features in boundary relations (typically `admin_centre` and `label` roles).
3. Move disputed boundary detection logic into SQL.

This will increase the database size slightly because of the limits of what imposm can do, as some of the filtering is done in the SQL layer after importing, rather than being done in `osmborder`.
2021-09-29 11:08:55 +02:00
Brian Sperlongano bfdbd829dc
Fix typo in transportation update (#1247)
This PR fixes a copy/paste error (identified by @zstadler's ongoing excellent work for update unit tests) in the `transportation_name` update code.
2021-09-24 16:16:31 +02:00
Brian Sperlongano 88389f2a2c
BUGFIX: Route concurrency data is wiped after route member updates (#1239)
This PR is a bugfix for the `transportation_name` layer.  Currently, the updates process does not work, as noted by @zstadler in #1230.  The issue is that the computed `concurrency_index` column in `osm_route_member` is never updated after the initial updates.  Therefore, whenever route member ways are updated, they will lose their route concurrency index, and hence route concurrencies will be lost in the `transportation_name` tiles.  This PR adds the missing concurrency index update code to the transportation/network update triggers.

This PR as written also incorporates the fixes in #1230 and #1233.

The following SQL is a unit test to demonstrate that these triggers work correctly:

```
select count(*) from osm_route_member where concurrency_index > 5;
select count(*) from osm_transportation_name_network where route_6 is not null;

update osm_route_member set concurrency_index=NULL where concurrency_index > 5;

select count(*) from osm_route_member where concurrency_index > 5;
select count(*) from osm_transportation_name_network where route_6 is not null;
```

If working correctly, both pairs of `count(*)` values should return the same pair of numbers.
2021-09-21 12:56:25 +02:00
Brian Sperlongano 8b6e69e440
BUGFIX: Ignore duplicate route concurrencies (#1233)
While troubleshooting #1230, I discovered that there were cases where a way was a member of the same route relation more than once, such as: https://www.openstreetmap.org/way/17439235

<img src="https://user-images.githubusercontent.com/3254090/133726616-acd01332-343e-4930-ad3d-1fb3c3190a4c.png" width=280/>

This segment would end up showing duplicate highway shields in a rendered style, which is not desirable.  While I personally think this style of tagging is wrong, it's a relatively easy fix to remove those duplicates.  This PR replaces `ROW_NUMBER()` with `DENSE_RANK()` in the concurrency index generation code and adds a `DISTINCT` constraint on the concurrency join to handle multiple member rows with the same concurrency index.

Since I was in this file, I also fixed the copy/paste error in generating the route names.

Screenshot from database showing correct mapping:
![image](https://user-images.githubusercontent.com/3254090/133725554-1aa5dbbc-59a8-4674-a446-b92adb96c2a1.png)
2021-09-20 18:40:36 +02:00
Jaroslav Hanslík d49f524edd
Removed useless NULLIF calls (#1214)
`NULLIF(wikipedia, '') IS NOT NULL` replaced by `wikipedia <> ''`
https://stackoverflow.com/questions/23766084/best-way-to-check-for-empty-or-null-value
2021-09-20 11:19:24 +02:00
Brian Sperlongano e8a3bc18c5
Remove landuse=park from landcover (#1208)
The tag `landuse=park` is a rare tagging mistake of `leisure=park`.  The OSM wiki [lists this tag as a mistake](https://wiki.openstreetmap.org/wiki/Tag:leisure%3Dpark).  It is included in the landcover layer with a note that there were (at the time) 600 parks tagged in this way.  There are currently a bit over 100 objects tagged with this mistake.  Based on the wiki documentation and obvious decline of this tag, we should remove it so that we're not introducing mapping mistakes into the database and not inadvertently providing mapper feedback that encourages the use of mistake tagging.
2021-09-20 10:23:26 +02:00
Brian Sperlongano 849aca8da7
Refactor z12-14 transportation filter logic (#1207)
This PR is a refactor.  The purpose of this PR is to refactor the logic in the z12-z14 transportation layer to increase readability and reduce code complexity.

In addition, this fixes bugs in the original filter code:
* Create filter parity between `service` and `service_construction` highway classes.
* Removal of unintended `class` values `minor_construction`, `path_construction`, `service_construction`, and `track_construction` from zoom 12 filter by explicitly listing the highway classes that are included.
2021-09-20 08:07:38 +02:00
Brian Sperlongano 5e37a811fb
Update devdocs (#1223) 2021-09-11 15:56:10 -04:00
Brian Sperlongano f947cbffc3
Add enhanced mountain features (#1202)
This PR adds support for several features in the `natural` key, including `saddle`, `ridge`, `arete`, and `cliff`.  These features all currently render in openstreetmap-carto, so adding these features would advance OpenMapTiles towards its goal of parity with the standard renderer, as indicated in https://github.com/openstreetmap/operations/issues/565#issuecomment-907303115.

This PR also adds the features requested in #274, with the exception of valleys, which I've left out of this PR because there are different complexities to mapping valleys that should be addressed as a separate (future) PR.

### Examples of mountain features in paper maps
These features are regularly found in American-style maps and thus is of interest to the openstreetmap-americana map style.  Below are examples of these mountain-related features found in general purpose maps:

<img src="https://user-images.githubusercontent.com/3254090/131270340-af80c7bf-9416-40a3-9b64-56418abb2aef.png" width=400/>
<img src="https://user-images.githubusercontent.com/3254090/131270375-b9eb2095-7708-443d-b7bc-22bf8adab721.png" width=400/>
<img src="https://user-images.githubusercontent.com/3254090/131270423-64447ad3-d90a-4615-82e1-91175a8f8a6b.png" width=400/>
<img src="https://user-images.githubusercontent.com/3254090/131270506-2248db9f-ded5-443f-82ed-b0e8d4d12a70.png" width=400/>

### Approach
This PR extends the existing `mountain_peak` layer by adding other mountain features.  We may want to consider renaming this layer in version 4.0 to be more inclusive of other mountain features including the potential future addition of valleys.  However, the features added in this PR are associated with mountains and so their inclusion in this layer is the most appropriate location.

A new `osm_mountain_linestring` mapping maps the new linear mountain features, with similar ranking logic as is used for the existing `peak`/`volcano` features.  Additionally, `natural=saddle` is added to the `osm_peak_point` mapping and ranked using the formula for peaks.  Since saddles will have lower elevations than peaks, important saddles will be preempted by important peaks.

The new linestring features are rendered only at zoom 13-14, in order to match the zoom at which they appear in openstreetmap-carto.  However, it may be appropriate in a future PR to extend the rendering of these features as generalized linestrings at lower zooms.

### Test Renderings
Below is a test rendering showing aretes and peaks in Austria, just north of the Swiss border, followed by a screen shot of the [same location](https://www.openstreetmap.org/#map=14/46.8682/10.0863) in openstreetmap-carto:

**OpenMapTiles, zoom 14**
<img src="https://user-images.githubusercontent.com/3254090/131271258-5cd90bdb-cac2-41d8-887f-b4bf6be83673.png" width=400/>
**openstreetmap-carto, zoom r14/v13:**
<img src="https://user-images.githubusercontent.com/3254090/131271332-32d5bcfc-41c6-4625-829c-df063b7af523.png" width=400/>
2021-09-01 12:21:18 +02:00
Brian Sperlongano 3818979143
Suppress service roads at certain zooms (#1192)
Fixes #1191

This PR suppresses `highway=service` at zoom 12, where it is not a useful level of detail.  This makes OpenMapTiles consistent with openstreetmap-carto, which does not begin showing `highway=service` until raster zoom 14 / vector zoom 13.

Additionally, this PR suppresses `highway=service` + `service=parking_aisle` / `service=driveway` from zooms 12-13, as this detail is excessive below zoom 14.  As a point of comparison, openstreetmap-carto does not begin showing `service=parking_aisle` / `service=driveway` until raster zoom 16 (vector zoom 15).
2021-09-01 09:18:45 +02:00
Brian Sperlongano d427d58e36
Water layer river mapping bug fixes (#1182)
This PR is a bugfix for the `water` layer.

* `waterway=stream`, `waterway=river`, `waterway=canal`, `waterway=ditch`, and `waterway=drain` are all linear features, not area features.  Thus, these objects are being unnecessarily mapped into the `osm_water_polygon` polygon table, and this PR removes these unneeded mappings.
* The combination `natural=water` + `water=river` is the most popular tagging for river areas.  However, the current mapping causes rivers tagged in this way to be rendered in the vector tiles as a `lake`.  This PR adds a check for the `water=river` tag and tags both variants of river areas as `class=river`.

`natural=water` + `water=river` river mapping:
![image](https://user-images.githubusercontent.com/3254090/129825551-388491de-549e-4843-80cc-01dba358c360.png)

`waterway=riverbank` river mapping:
![image](https://user-images.githubusercontent.com/3254090/129825618-4239eae7-a2bc-4a82-9931-fda2c02c2b40.png)


Lake mapping for a `natural=water` (with no other tagging):
![image](https://user-images.githubusercontent.com/3254090/129825554-9394b3d3-988a-4e92-a9f8-b198c695ec37.png)
2021-09-01 08:24:01 +02:00
Brian Sperlongano 0e17d53f42
Implement park rendering at z4-5 (#1160)
Unblocks ZeLonewolf/openstreetmap-americana#51

Currently, OpenMapTiles renders protected areas at zoom 6 and higher.  However, the western United States has protected areas that are so vast that it makes sense to render these areas as low as zoom 4, as noted in ZeLonewolf/openstreetmap-americana#51

This PR extends the generalization of park features from its current termination at zoom 6 to zoom 4.

Here is an example from the Americana style of rendering protected areas at zoom 6, which is currently the lowest supported zoom:
https://zelonewolf.github.io/openstreetmap-americana/#6/45.313/-111.721

We would like to provide rendering at zoom 4 (no labels) and zoom 5 (with labels) in the Americana style.  Below are samples generated from this PR for Idaho, USA:

Zoom 4:
![image](https://user-images.githubusercontent.com/3254090/126924222-e21865e9-b184-479a-abd5-46238bd106f8.png)

Zoom 5:
![image](https://user-images.githubusercontent.com/3254090/126924230-01853e8c-d3e0-41e8-b10f-06415da529d8.png)
2021-09-01 07:20:52 +02:00
Brian Sperlongano b88bd6abb5
Add locksmith shop (#1188)
Fixes #566

This PR adds support for `shop=locksmith`.

Example OSM object: https://www.openstreetmap.org/way/874850561

Rendered tile:
![image](https://user-images.githubusercontent.com/3254090/130335938-e76cf3d2-dfe7-4398-a647-463fc216d674.png)
2021-08-23 18:31:25 +02:00
Brian Sperlongano 7e9a6812d7
Add international airports at z8-9 (#1187)
Closes #1082

This PR moves the aerodrome/aerodrome_type consolidation (via template) into the lower-level `osm_aerodrome_label_point` table, and creates a partial index on class `international` for airports with an `iata` code.  The presence of an `iata` code is more significant than an `icao` code which exists at many smaller, general aviation airport.  Therefore, `international` + `iata` should be a sufficient filter.

Zoom 8 international airports in the NYC area (blue dots):
![image](https://user-images.githubusercontent.com/3254090/130335311-10b7aa35-d2f9-42cc-a054-878048012040.png)

Zoom 10 in the same area:
![image](https://user-images.githubusercontent.com/3254090/130335327-3989cfba-80ca-46dd-a157-45b375f84a8d.png)
2021-08-23 14:14:50 +02:00
Brian Sperlongano aee838e29f
Change zoom level for NE states/provinces (#1184)
Fixes #1055 

This PR moves Natural Earth zoom 7.7 boundary lines into zoom 4.

> Hi, thank you for PR. In github-actions statistics there is a pretty high size increase in zooms 3, 2, 1, which are using data from zoom 4. Maybe keep your change to move `min_zoom <= 7.7` just for zoom 4, but for zoom 3 add a condition `min_zoom <= 7` (that subsequently the condition bubbles into zoom 2 and 1). What do you think?

I agree that this makes sense, and thank you for pointing it out.  It didn't occur to me that the zoom 1-3 tables were unbounded.  I made the change to pull the `min_zoom` column into the zoom 4 generalized table and filter for `min_zoom< 7`.

With this change, here is Algeria, zoom 3:
![image](https://user-images.githubusercontent.com/3254090/130368190-616891f4-4a53-4780-926b-561007291f33.png)

Algeria, zoom 4:
![image](https://user-images.githubusercontent.com/3254090/130368194-d4e722bb-559b-4e2a-bb82-a5d1bd95985c.png)
2021-08-23 11:49:19 +02:00
Brian Sperlongano a93b708327
Implement shipway labels (#1179)
Fixes #403 

This PR adds labels to shipway linestrings in the `transportation_name` level, up through zoom 12.

![image](https://user-images.githubusercontent.com/3254090/129659827-662ee13c-27f3-4e62-a7f4-45dbd535b770.png)
2021-08-23 10:52:15 +02:00
Brian Sperlongano 6ef138635d
Fix negative feature IDs (#1185)
This PR removes the possibility of negative feature IDs for the `aerodrome_label` layer by defining the feature as the absolute value of the OSM id (imposm maps relations with negative numbers).  There is a very unlikely  scenario in which a relation and a way have the same ID (and are also in the same tile), however, unique IDs are not a strict requirement of MVT.

Noted in:
https://github.com/openmaptiles/openmaptiles/pull/1176#issuecomment-902503655

Positive feature ID for Quonset State Airport, which is mapped as a relation:
![image](https://user-images.githubusercontent.com/3254090/130232322-c797d491-ece9-4889-9695-ffb6f3ac011f.png)
2021-08-20 16:40:02 +02:00
Brian Sperlongano 36bd917e05
Implement feature IDs in aerodrome_label and mountain_peak (#1176) 2021-08-19 21:03:40 +02:00
Brian Sperlongano 7ca751ec7a
Add toll tagging (#1177)
Fixes #366

This PR sets `toll=1` in the `transportation` layer when a road is tagged as a toll road in OSM (with the tag `toll=yes`).  If a road is tagged with any other value of `tag=*`, the value is suppressed in the tile, since non-toll roads can be presumed as the default and therefore this PR should have only negligible impact in the tiles.

Support for toll road tagging is of interest in the American mapping community, because toll roads have historically been styled differently on American-style maps, for example:
![image](https://user-images.githubusercontent.com/3254090/129505967-5916eace-596a-4c89-ac5d-0aab3e641ed7.png)


Screen shot of a toll road being generated in the `transportation` layer tiles:
![image](https://user-images.githubusercontent.com/3254090/129505683-eb315643-95ff-455b-a606-f379f776f92d.png)
2021-08-19 07:12:10 +02:00
zstadler e37076c133
Add spring water bodies (#1167)
The [OSM wiki](https://wiki.openstreetmap.org/wiki/Tag:natural%3Dspring) says `natural=spring` may be used on areas.
2021-08-18 17:46:15 +02:00
Brian Sperlongano d186856ac5
Add support for cemetery tagged as grave_yard (#1175)
Fixes #1057

This PR adds `amenity=grave_yard` to the `landuse` layer.  A unification function was implemented which encodes all `class=grave_yard` as `class=cemetery` in the tiles, which adds these features for existing users of `class=cemetery` with no change.  The unification function can serve as a basis for any other tags that we might want to unify in the `landuse` layer.

Tile rendering for an `amenity=grave_yard`.  ([Location](https://www.openstreetmap.org/way/857383420))
![image](https://user-images.githubusercontent.com/3254090/129456504-187d307a-2a20-4b13-af0a-a2850503bb4f.png)

Tile rendering for a `landuse=cemetery`.  ([Location](https://www.openstreetmap.org/way/385779531))
![image](https://user-images.githubusercontent.com/3254090/129456654-494c0eb4-9785-467c-b1a0-44abb7f9d5e9.png)
2021-08-18 09:09:51 +02:00
Brian Sperlongano 45d825e212
Implement private road tagging (#1174)
Fixes #1066 

This PR adds a new field `access` in the transportation layer, which will be set to `no` if the `access` tag is either `no` or `private`.  While `private` is the more popular value by a 17:1 ratio, I went with `no` because it's smaller in the tiles.  In addition, the text `no` opens up the future possibility of other text-based access values such as `destination`, `customers`, or `permit`.

The screenshot below shows an example of access tagging for a road on a military base:

![image](https://user-images.githubusercontent.com/3254090/129431491-9acbaeca-bf18-4384-8177-2c198834865c.png)
2021-08-14 07:04:17 +02:00
Brian Sperlongano fdb9ae58cd
Transportation generalization table optimization and cleanup (#1172)
This PR updates the `transportation` layer creation scripts to simplify the SQL and remove unneeded sub-selects, checks and conditionals, fix indexes, and improve inline documentation. 

Currently, there are two sequences of materialized view creations.  There is one from zoom 11 through 9, and a second one for zoom 8 through 4.  This PR removes that break in the sequence of transportation table materialized view creations, in favor of one in which high-zoom views are created first, and then each lower zoom is created from the zoom above.

Instead, the current generalized zoom 8 transportation table is built directly from `osm_transportation_linestring` rather than being built from the zoom 9 transportation table.  This means that when building the zoom 8 table, it must scan the entire transportation network rather than just selecting from the pre-filtered zoom 9 table.

This PR removes an unneeded sub-select in the build of the zoom 8 table, which appears to be a leftover from an old version of the SQL that did some sort of merge.  Once this PR is implemented all zooms from 11 through 4 will be linked via a progressive series of materialized views.

Lastly, this adds in missing materialized view refreshes for zooms 9-11, which appear to have been entirely missing, and as far as I can tell aren't getting updated in the current version of this code.

In addition, the following optimizations were added as part of this commit:

1. Updates the `osm_highway_linestring_highway_partial_idx` partial index to match the `SELECT..WHERE` clause actually present in `transportation/update_route_member.sql`, which is where it appears to be actually used, and update inline documentation to reflect this.

2. Collapses unnecessary sub-select block in `osm_transportation_merge_linestring_gen_z11`, and removes unnecessary ST_IsValid() call, which already provided in `mapping.yaml`, and update inline documentation to reflect these assumptions.

3. Updates `WHERE` blocks to remove unnecesary checks and further document assumptions.  The `highway=construction` check is unnecessary in all cases, because it is sufficient to check the `construction` key alone.  If `construction=*` is set, then `highway=construction` is implied.

4. Two indexes were added to `layers/transportation/update_route_member.sql` to improve route population performance.

In testing locally, I'm seeing performance improvements around 10% in the generation of the `transportation` layer, based on modifying `openmaptiles.yaml` to generate only the transportation layer and then repeatedly running `time make import-sql`, however, this timing might be impacted by docker, so I would ask for confirmation of acceptable performance.

In addition, this PR shortens the length of the transportation update SQL file by 30 lines, which makes it easier for contributors to work with.
2021-08-13 18:00:33 +02:00