-
Notifications
You must be signed in to change notification settings - Fork 120
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
Export wikidata properties #1871
Changes from 3 commits
8616e54
b815c6c
dd46dcf
e458e3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -743,6 +743,7 @@ Places with `kind` values of `continent`, `country`, with others added starting | |
* `max_zoom`: a suggested maximum zoom beyond which the place should not be visible. Currently neighbourhoods only, from Who's On First. | ||
* `is_landuse_aoi`: Currently neighbourhoods only, from Who's On First | ||
* `kind_detail`: the original value of the OSM `place` tag and Natural Earth `featurecla`, see below. | ||
* `wikidata`: when present, the [Wikidata](https://www.wikidata.org) ID corresponding to this feature. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's export these as |
||
|
||
#### Place `kind` values: | ||
|
||
|
@@ -827,6 +828,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o | |
* `exit_to`: only for highway exits | ||
* `ref`: generally only for `aeroway_gate` and `station_entrance` features | ||
* `religion`: TODO | ||
* `wikidata`: when present, the [Wikidata](https://www.wikidata.org) ID corresponding to this feature. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* `zoo`: TODO | ||
|
||
#### POI properties (only on `kind:station`): | ||
|
@@ -2374,6 +2376,7 @@ Tilezen calculates the composite exterior edge for overlapping water polygons an | |
* `area`: in square meters (spherical Mercator, no real-world), `polygon` features only | ||
* `id`: OpenStreetMap feature `osm_id`, when sourced from `openstreetmap.org` | ||
* `is_tunnel`: for `line` features only (`true` values only) | ||
* `wikidata`: when present, the [Wikidata](https://www.wikidata.org) ID corresponding to this feature. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
#### Water `kind` values: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -926,6 +926,29 @@ def test_plaque_node(self): | |
'kind': u'plaque', | ||
}) | ||
|
||
def test_memorial_node(self): | ||
# if a memorial _isn't_ a plaque, then it should stay as a memorial! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth a note in the changelog! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added #1872 to remind us to put into changelog. |
||
# this is the counter-example to test_plaque_node above, as previously | ||
# there was a bug where the test for plaque was too general and | ||
# accidentally re-classified all memorials as plaques. | ||
import dsl | ||
|
||
z, x, y = (16, 0, 0) | ||
|
||
self.generate_fixtures( | ||
dsl.way(1, dsl.tile_centre_shape(z, x, y), { | ||
'historic': u'memorial', | ||
'name': u'A. Name Here', | ||
'source': u'openstreetmap.org', | ||
}), | ||
) | ||
|
||
self.assert_has_feature( | ||
z, x, y, 'pois', { | ||
'id': 1, | ||
'kind': 'memorial', | ||
}) | ||
|
||
def test_reef_way(self): | ||
import dsl | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# -*- encoding: utf-8 -*- | ||
from . import FixtureTest | ||
|
||
|
||
class OSMTest(FixtureTest): | ||
|
||
def test_place(self): | ||
import dsl | ||
|
||
z, x, y = (16, 10482, 25330) | ||
|
||
self.generate_fixtures( | ||
# https://www.openstreetmap.org/node/26819236 | ||
dsl.point(26819236, (-122.4199061, 37.7790262), { | ||
'name': u'San Francisco', | ||
'place': u'city', | ||
'population': u'864816', | ||
'rank': u'10', | ||
'short_name': u'SF', | ||
'source': u'openstreetmap.org', | ||
'wikidata': u'Q62', | ||
'wikipedia': u'en:San Francisco', | ||
}), | ||
) | ||
|
||
self.assert_has_feature( | ||
z, x, y, 'places', { | ||
'id': 26819236, | ||
'kind': 'locality', | ||
'kind_detail': 'city', | ||
'wikidata': 'Q62', | ||
}) | ||
|
||
def test_poi(self): | ||
import dsl | ||
|
||
z, x, y = (16, 10482, 25330) | ||
|
||
self.generate_fixtures( | ||
# https://www.openstreetmap.org/node/1901905716 | ||
dsl.point(1901905716, (-122.4185377, 37.7789014), { | ||
'historic': u'memorial', | ||
'name': u'Abraham Lincoln', | ||
'source': u'openstreetmap.org', | ||
'wikidata': u'Q20011487', | ||
}), | ||
) | ||
|
||
self.assert_has_feature( | ||
z, x, y, 'pois', { | ||
'id': 1901905716, | ||
'kind': u'memorial', | ||
'wikidata': u'Q20011487', | ||
}) | ||
|
||
def test_water(self): | ||
import dsl | ||
|
||
z, x, y = (16, 10752, 32895) | ||
|
||
self.generate_fixtures( | ||
# https://www.openstreetmap.org/node/305640005 | ||
dsl.way(305640005, dsl.tile_centre_shape(z, x, y), { | ||
'name': u'Pacific Ocean', | ||
'place': u'ocean', | ||
'source': u'openstreetmap.org', | ||
'wikidata': u'Q98', | ||
}), | ||
) | ||
|
||
self.assert_has_feature( | ||
z, x, y, 'water', { | ||
'id': 305640005, | ||
'kind': u'ocean', | ||
'wikidata': u'Q98', | ||
}) | ||
|
||
|
||
class WOFTest(FixtureTest): | ||
|
||
def test_place(self): | ||
import dsl | ||
|
||
z, x, y = (16, 10483, 25328) | ||
|
||
self.generate_fixtures( | ||
dsl.point(85865903, (-122.414102, 37.785926), { | ||
"max_zoom": 18.0, | ||
"min_zoom": 15.0, | ||
"name": "Tenderloin", | ||
"placetype": "neighbourhood", | ||
"source": "whosonfirst.org", | ||
"wikidata": "Q7464", | ||
}), | ||
) | ||
|
||
self.assert_has_feature( | ||
z, x, y, 'places', { | ||
'id': 85865903, | ||
'kind': 'neighbourhood', | ||
'wikidata': 'Q7464', | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ global: | |
call: | ||
func: util.true_or_none | ||
args: [ { col: is_landuse_aoi } ] | ||
wikidata: {col: wikidata} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Export as |
||
|
||
- &ne_places_min_zoom | ||
lookup: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ global: | |
attraction: {col: attraction} | ||
zoo: {col: zoo} | ||
exit_to: {col: exit_to} | ||
wikidata: {col: wikidata} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Export as |
||
- &transit_properties | ||
mz_transit_score: {col: mz_transit_score} | ||
mz_transit_root_relation_id: {col: mz_transit_root_relation_id} | ||
|
@@ -2245,7 +2246,9 @@ filters: | |
# memorial plaques more specific than plain memorials | ||
- filter: | ||
any: | ||
- {historic: memorial, memorial: plaque} | ||
- all: | ||
- historic: memorial | ||
- memorial: plaque | ||
- historic: memorial_plaque | ||
min_zoom: 16 | ||
output: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ globals: | |
label_placement: {col: label_placement} | ||
boundary: {col: boundary} | ||
tunnel: {col: tunnel} | ||
wikidata: {col: wikidata} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Export as |
||
- &water_standard_properties_osm | ||
<<: *output_properties | ||
intermittent: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
wikidata_id
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could leave as wikidata here, might make import easier. But the ETL should transform it to
wikidata_id
on export.