-
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
Move to NE 5.1.2 - Add Config for new POVs #2078
Changes from 8 commits
e853595
fc1f2c6
776ff67
b05b25d
b810954
b51e372
e0fa3de
a4b218a
1a8a020
3ba8648
31a5b4a
761ae3c
2635448
2e59334
1185427
24c86c9
8fb9226
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
bucket: nextzen-tile-assets | ||
datestamp: 20220426 | ||
datestamp: 20220429 | ||
|
||
shapefiles: | ||
|
||
|
@@ -55,98 +55,104 @@ shapefiles: | |
url: http://s3.amazonaws.com/tilezen-assets/curated/admin_areas_20180409.zip | ||
|
||
- name: ne_110m_lakes | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_lakes.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/110m/physical/ne_110m_lakes.zip | ||
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. Thanks for switching these to versioned CDN links... much more obvious which version we're on and makes updating NE a deliberate process. 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. I agree. Much clearer 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. These will all need to switch to 5.1.1 to pick up the other change. |
||
|
||
- name: ne_50m_lakes | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/ne_50m_lakes.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/physical/ne_50m_lakes.zip | ||
|
||
- name: ne_10m_lakes | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_lakes.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/physical/ne_10m_lakes.zip | ||
|
||
- name: ne_110m_ocean | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_ocean.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/110m/physical/ne_110m_ocean.zip | ||
|
||
- name: ne_50m_ocean | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/ne_50m_ocean.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/physical/ne_50m_ocean.zip | ||
|
||
- name: ne_10m_ocean | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_ocean.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/physical/ne_10m_ocean.zip | ||
|
||
- name: ne_50m_playas | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/ne_50m_playas.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/physical/ne_50m_playas.zip | ||
|
||
- name: ne_10m_playas | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_playas.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/physical/ne_10m_playas.zip | ||
|
||
- name: ne_50m_urban_areas | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_urban_areas.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/cultural/ne_50m_urban_areas.zip | ||
|
||
- name: ne_10m_urban_areas | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_urban_areas.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_urban_areas.zip | ||
|
||
- name: ne_110m_land | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_land.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/110m/physical/ne_110m_land.zip | ||
|
||
- name: ne_50m_land | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/ne_50m_land.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/physical/ne_50m_land.zip | ||
|
||
- name: ne_10m_land | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_land.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/physical/ne_10m_land.zip | ||
tile: true | ||
|
||
- name: ne_10m_populated_places | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_populated_places.zip | ||
|
||
- name: ne_110m_admin_0_boundary_lines_land | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip | ||
|
||
- name: ne_50m_admin_0_boundary_lines_land | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_boundary_lines_land.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/cultural/ne_50m_admin_0_boundary_lines_land.zip | ||
|
||
- name: ne_10m_admin_0_boundary_lines_land | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_boundary_lines_land.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_0_boundary_lines_land.zip | ||
|
||
- name: ne_10m_admin_0_boundary_lines_map_units | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_boundary_lines_map_units.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_0_boundary_lines_map_units.zip | ||
|
||
- name: ne_50m_admin_1_states_provinces_lines | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_1_states_provinces_lines.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/cultural/ne_50m_admin_1_states_provinces_lines.zip | ||
|
||
- name: ne_10m_admin_1_states_provinces_lines | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip | ||
|
||
- name: ne_50m_admin_0_boundary_lines_disputed_areas | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_boundary_lines_disputed_areas.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/cultural/ne_50m_admin_0_boundary_lines_disputed_areas.zip | ||
|
||
- name: ne_50m_admin_0_boundary_lines_maritime_indicator_chn | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_boundary_lines_maritime_indicator_chn.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/cultural/ne_50m_admin_0_boundary_lines_maritime_indicator_chn.zip | ||
|
||
- name: ne_10m_admin_0_boundary_lines_disputed_areas | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_boundary_lines_disputed_areas.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_0_boundary_lines_disputed_areas.zip | ||
|
||
- name: ne_10m_admin_0_boundary_lines_maritime_indicator_chn | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_boundary_lines_maritime_indicator_chn.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_0_boundary_lines_maritime_indicator_chn.zip | ||
|
||
- name: ne_10m_roads | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_roads.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_roads.zip | ||
|
||
- name: ne_110m_coastline | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_coastline.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/110m/physical/ne_110m_coastline.zip | ||
|
||
- name: ne_50m_coastline | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/ne_50m_coastline.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/50m/physical/ne_50m_coastline.zip | ||
|
||
- name: ne_10m_coastline | ||
url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_coastline.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/physical/ne_10m_coastline.zip | ||
|
||
- name: ne_10m_admin_0_countries | ||
url: https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_0_countries.zip | ||
|
||
- name: ne_10m_admin_0_countries_iso | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_0_countries_iso.zip | ||
|
||
- name: ne_10m_admin_0_countries_tlc | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_0_countries_tlc.zip | ||
|
||
- name: ne_10m_admin_0_map_units | ||
url: https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_map_units.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_0_map_units.zip | ||
|
||
- name: ne_10m_admin_1_states_provinces | ||
url: https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces.zip | ||
url: https://naciscdn.org/naturalearth/5.1.0/10m/cultural/ne_10m_admin_1_states_provinces.zip | ||
|
||
wikidata-queries: | ||
- name: aerodrome_passenger_count | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -996,7 +996,7 @@ $$ LANGUAGE plpgsql IMMUTABLE; | |
-- returns a JSONB object containing __ne_min_zoom and __ne_max_zoom set to the | ||
-- label min and max zoom of any matching row from the Natural Earth countries, | ||
-- map units and states/provinces themes. | ||
CREATE OR REPLACE FUNCTION tz_get_ne_min_max_zoom(wikidata_id TEXT) | ||
CREATE OR REPLACE FUNCTION tz_get_ne_min_max_zoom(wikidata_id TEXT, place_tag TEXT) | ||
RETURNS JSONB AS $$ | ||
DECLARE | ||
min_zoom REAL; | ||
|
@@ -1006,28 +1006,30 @@ BEGIN | |
RETURN '{}'::jsonb; | ||
END IF; | ||
|
||
-- first, try the countries table | ||
SELECT | ||
min_label, max_label INTO min_zoom, max_zoom | ||
FROM ne_10m_admin_0_countries c | ||
WHERE c.wikidataid = wikidata_id; | ||
-- if it's a country, only look it up in the iso and tlc tables | ||
IF place_tag='country' OR place_tag='unrecognized' THEN | ||
SELECT | ||
min_label, max_label INTO min_zoom, max_zoom | ||
FROM ne_10m_admin_0_countries_iso i | ||
WHERE i.wikidataid = wikidata_id; | ||
|
||
-- if that fails, try map_units (which contains some sub-country but super- | ||
-- state level stuff such as England, Scotland and Wales). | ||
IF NOT FOUND THEN | ||
SELECT | ||
min_label, max_label INTO min_zoom, max_zoom | ||
FROM ne_10m_admin_0_map_units mu | ||
WHERE mu.wikidataid = wikidata_id; | ||
IF NOT FOUND THEN | ||
SELECT | ||
min_label, max_label INTO min_zoom, max_zoom | ||
FROM ne_10m_admin_0_countries_tlc t | ||
WHERE t.wikidataid = wikidata_id; | ||
END IF; | ||
|
||
IF NOT FOUND THEN | ||
RETURN '{}'::jsonb; | ||
END IF; | ||
END IF; | ||
|
||
-- try states and provinces | ||
IF NOT FOUND THEN | ||
nvkelso marked this conversation as resolved.
Show resolved
Hide resolved
|
||
SELECT | ||
-- try states and provinces if it's not a country | ||
SELECT | ||
min_label, max_label INTO min_zoom, max_zoom | ||
FROM ne_10m_admin_1_states_provinces sp | ||
WHERE sp.wikidataid = wikidata_id; | ||
END IF; | ||
|
||
-- finally, try localities | ||
-- There is no concept of max_zoom for ne_10m_populated_places | ||
|
@@ -1051,6 +1053,65 @@ BEGIN | |
END; | ||
$$ LANGUAGE plpgsql STABLE; | ||
|
||
CREATE OR REPLACE FUNCTION tz_get_fclass_and_label_position(wikidata_id TEXT, place_tag TEXT) | ||
RETURNS JSONB AS $$ | ||
DECLARE | ||
fclass_iso TEXT; | ||
fclass_tlc TEXT; | ||
label_x REAL; | ||
label_y REAL; | ||
BEGIN | ||
IF wikidata_id IS NULL THEN | ||
RETURN '{}'::jsonb; | ||
END IF; | ||
|
||
-- if it's a country, only look it up in the iso and tlc tables | ||
IF place_tag='country' OR place_tag='unrecognized' THEN | ||
SELECT | ||
fclass_iso, fclass_tlc, label_x, label_y INTO fclass_iso, fclass_tlc, label_x, label_y | ||
FROM ne_10m_admin_0_countries_iso i | ||
WHERE i.wikidataid = wikidata_id; | ||
|
||
IF NOT FOUND THEN | ||
SELECT | ||
fclass_iso, fclass_tlc, label_x, label_y INTO fclass_iso, fclass_tlc, label_x, label_y | ||
FROM ne_10m_admin_0_countries_tlc t | ||
WHERE t.wikidataid = wikidata_id; | ||
END IF; | ||
|
||
IF NOT FOUND THEN | ||
RETURN '{}'::jsonb; | ||
END IF; | ||
END IF; | ||
|
||
-- There is no label_x and label_y for the non-countries | ||
SELECT | ||
fclass_iso, fclass_tlc, NULL, NULL INTO fclass_iso, fclass_tlc, label_x, label_y | ||
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. This is confusingly called: "latitude" (label_y) and "longitude" (label_x) in the NE admin-1 table. Please update to pull them out. 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. (so keep the output as label_{x,y} but the input would be 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. fixed in 31a5b4a |
||
FROM ne_10m_admin_1_states_provinces sp | ||
WHERE sp.wikidataid = wikidata_id; | ||
|
||
-- finally, try localities | ||
IF NOT FOUND THEN | ||
SELECT | ||
fclass_iso, fclass_tlc, NULL, NULL INTO fclass_iso, fclass_tlc, label_x, label_y | ||
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. Same deal: This is confusingly called: "latitude" (label_y) and "longitude" (label_x) in the NE populated places table. Please update to pull them out. 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. fixed in 31a5b4a |
||
FROM ne_10m_populated_places pp | ||
WHERE pp.wikidataid = wikidata_id;END IF; | ||
|
||
-- return an empty JSONB rather than null, so that it can be safely | ||
-- concatenated with whatever other JSONB rather than needing a check for | ||
-- null. | ||
IF NOT FOUND THEN | ||
RETURN '{}'::jsonb; | ||
END IF; | ||
RETURN jsonb_build_object( | ||
'__ne_fclass_iso', fclass_iso, | ||
'__ne_fclass_tlc', fclass_tlc, | ||
'__ne_label_x', label_x, | ||
'__ne_label_y', label_y | ||
); | ||
END; | ||
$$ LANGUAGE plpgsql STABLE; | ||
|
||
|
||
-- returns a JSONB object containing __ne_pop_min and __ne_pop_max | ||
CREATE OR REPLACE FUNCTION tz_get_ne_pop_min_max(wikidata_id TEXT) | ||
|
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: but 5.1.0 was only officially released on May 4th, so bring this forward?
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.
updated to most recent (which I think @jeffdefacto found an issue in for the iso countries.zip)
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.
That zero length char definition is really odd. Opens fine in QGIS but PostGIS barfs on it (saying it doesn't support 0 length varchar fields).
Filed mbloch/mapshaper#541 upstream.
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.
With mbloch/mapshaper#541 fixed upstream, I'll update Natural Earth to v5.1.1 with the fix.
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.
Natural Earth 5.1.1 is now out, please update here and see if the problem persists.