Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change area decisions at import time #4032

Merged
merged 32 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5dd3c43
Import railway=station as a polygon feature
jeisenbe Apr 10, 2019
735e719
Merge tag 'v4.21.1' into schema_changes
pnorman May 30, 2019
0b5daba
Add boundary=national_park and =protected_area to polygon values
jeisenbe Jan 21, 2019
8141f3b
Add boundary=aboriginal_lands to polygon values
jeisenbe May 19, 2019
09eefd9
Add healthcare tag to lua
jeisenbe Jan 16, 2019
3bf6a13
Import allotments as a polygon key
jeisenbe May 19, 2019
cf61fea
Import railway=station as a polygon (#3787)
matkoniecz Jun 23, 2019
bf5b705
Merge branch 'schema_changes' into national-park-closed-way
jeisenbe Jul 27, 2019
41793e8
Add tourism=yes as a linestring exception in the import schema
jeisenbe Aug 2, 2019
4615013
Merge pull request #3833 from jeisenbe/schema-changes-tourism-yes
pnorman Aug 8, 2019
28862d4
Merge pull request #3786 from jeisenbe/schema-plots
pnorman Aug 15, 2019
771b10a
Merge tag 'v4.22.0' into schema_changes
pnorman Aug 28, 2019
39d7c7b
Merge tag 'v4.24.1' into schema_changes
jeisenbe Nov 15, 2019
094aa5d
Import man_made=pipeline, man_made=cutline and power=cable as linestr…
jeisenbe Jan 8, 2020
3cb4cc8
Add aerialway=station to polygon features
jeisenbe Jan 12, 2020
3e37572
Merge pull request #4003 from jeisenbe/schema-aerialway-station
pnorman Jan 28, 2020
322ee0e
Merge branch 'schema_changes' into national-park-closed-way
jeisenbe Jan 28, 2020
bbfbba7
Import natural=earth_bank as a linestring only
jeisenbe Jan 28, 2020
a5cb5e9
Import `craft=` as a polygon key
jeisenbe Jan 28, 2020
a78ffdb
Merge tag 'v4.25.0' into schema_changes
jeisenbe Feb 1, 2020
2c64259
Import waterway=tidal_channel as a linestring (#4014)
jeisenbe Feb 2, 2020
23cf9a2
Import closed ways with the key `club=` as polygons
jeisenbe Feb 3, 2020
05b6c04
Import emergency= features as polygons, with exceptions
jeisenbe Feb 3, 2020
f431d2f
Merge pull request #4015 from jeisenbe/schema-craft
pnorman Feb 6, 2020
1d2eec5
Make area_tag=no not cause an area
pnorman Feb 6, 2020
3c50c18
Merge pull request #4013 from jeisenbe/schema-earth_bank
pnorman Feb 6, 2020
3bbd9dd
Merge pull request #4020 from jeisenbe/schema-club
pnorman Feb 6, 2020
c6a34b7
Import golf closed ways as polygons, with exceptions (#4017)
jeisenbe Feb 6, 2020
a636608
Merge pull request #4025 from gravitystorm/area_no
pnorman Feb 6, 2020
e7b21c7
Merge pull request #3785 from jeisenbe/national-park-closed-way
pnorman Feb 12, 2020
f646dba
Merge remote-tracking branch 'upstream/pr/4023' into schema_changes
pnorman Feb 12, 2020
d35bcc1
Update index for ferries
Nakaner Sep 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion indexes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

CREATE INDEX planet_osm_line_ferry
ON planet_osm_line USING GIST (way)
WHERE route = 'ferry';
WHERE route = 'ferry' AND osm_id > 0;
CREATE INDEX planet_osm_line_name
ON planet_osm_line USING GIST (way)
WHERE name IS NOT NULL;
Expand Down
2 changes: 1 addition & 1 deletion indexes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ line:
name:
where: name IS NOT NULL
ferry:
where: route = 'ferry'
where: route = 'ferry' AND osm_id > 0
river:
where: waterway = 'river'
polygon:
Expand Down
24 changes: 18 additions & 6 deletions openstreetmap-carto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ local polygon_keys = {
'abandoned:landuse',
'abandoned:power',
'aeroway',
'allotments',
'amenity',
'area:highway',
'craft',
'building',
'building:part',
'club',
'golf',
'emergency',
'harbour',
'healthcare',
'historic',
'landuse',
'leisure',
Expand All @@ -33,18 +39,24 @@ local polygon_keys = {

-- Objects with any of the following key/value combinations will be treated as linestring
local linestring_values = {
golf = {cartpath = true, hole = true, path = true},
emergency = {designated = true, destination = true, no = true, official = true, yes = true},
historic = {citywalls = true},
leisure = {track = true, slipway = true},
man_made = {embankment = true, breakwater = true, groyne = true},
natural = {cliff = true, tree_row = true, ridge = true, arete = true},
power = {line = true, minor_line = true},
waterway = {canal = true, derelict_canal = true, ditch = true, drain = true, river = true, stream = true, wadi = true, weir = true}
man_made = {breakwater = true, cutline = true, embankment = true, groyne = true, pipeline = true},
natural = {cliff = true, earth_bank = true, tree_row = true, ridge = true, arete = true},
power = {cable = true, line = true, minor_line = true},
tourism = {yes = true},
waterway = {canal = true, derelict_canal = true, ditch = true, drain = true, river = true, stream = true, tidal_channel = true, wadi = true, weir = true}
}

-- Objects with any of the following key/value combinations will be treated as polygon
local polygon_values = {
aerialway = {station = true},
boundary = {aboriginal_lands = true, national_park = true, protected_area= true},
highway = {services = true, rest_area = true},
junction = {yes = true}
junction = {yes = true},
railway = {station = true}
}

-- The following keys will be deleted
Expand Down Expand Up @@ -392,7 +404,7 @@ function isarea (tags)
for k, v in pairs(tags) do
-- Check if it has a polygon key and not a linestring override, or a polygon k=v
for _, ptag in ipairs(polygon_keys) do
if k == ptag and not (linestring_values[k] and linestring_values[k][v]) then
if k == ptag and v ~= "no" and not (linestring_values[k] and linestring_values[k][v]) then
return 1
end
end
Expand Down
3 changes: 3 additions & 0 deletions scripts/lua/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ assert(isarea({waterway = "river"}) == 0, "test failed: river")
assert(isarea({waterway = "riverbank"}) == 1, "test failed: river")
assert(isarea({highway = "services"}) == 1, "test failed: river")
assert(isarea({natural="cliff"}) == 0, "test failed: cliff") -- issue #3084
assert(isarea({building = "no"}) == 0, "test failed: building=no")
assert(isarea({building = "no", area = "yes"}) == 1, "test failed: building=no with area tag")
assert(isarea({building = "no", landuse = "forest"}) == 1, "test failed: building=no with other area tag")

print("TESTING: filter_tags_generic")
assert(({filter_tags_generic({})})[1] == 1, "Untagged filter")
Expand Down