Skip to content

Commit

Permalink
Correction to US Minor Outlying Islands and French Southern and Antar…
Browse files Browse the repository at this point in the history
…ctic Lands.
  • Loading branch information
MattBlissett committed Sep 27, 2023
1 parent 46c234b commit 4f8649c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 11 deletions.
17 changes: 14 additions & 3 deletions database/import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,17 @@ function import_political() {
echo "WITH osm AS (SELECT osm.geom FROM osm WHERE osm_id = '1650407')" \
"UPDATE political SET geom = ST_Difference(political.geom, osm.geom) FROM osm WHERE iso_ter1 = 'FIN';" | exec_psql

# United States / United States Minor Outlying Islands
# https://en.wikipedia.org/wiki/ISO_3166-2:UM
# Remove Midway Atoll (United States Minor Outlying Islands) from Hawaii
echo "WITH handdrawn AS (SELECT ST_GeomFromEWKT('SRID=4326;POLYGON ((-177.04996373497760942 31.60978833477749461, -177.83691262724664739 24.87185288052087273, -177.66332700965642744 24.37901220724413065, -177.36250316477767797 24.6621005824437951, -175.72778425823611315 31.30369873179363793, -176.27520866730711191 31.83088711396169757, -177.04996373497760942 31.60978833477749461))') AS geom)," \
"midway AS (SELECT ST_Intersection(handdrawn.geom, political.geom) AS geom FROM political, handdrawn WHERE mrgid_eez = 8453)" \
"INSERT INTO political (\"union\", territory1, iso_ter1, iso_sov1, geom) SELECT 'Midway Atoll', 'Midway Atoll', 'UMI', 'UMI', ST_Multi(geom) FROM midway;" | exec_psql
echo "WITH handdrawn AS (SELECT ST_GeomFromEWKT('SRID=4326;POLYGON ((-177.04996373497760942 31.60978833477749461, -177.83691262724664739 24.87185288052087273, -177.66332700965642744 24.37901220724413065, -177.36250316477767797 24.6621005824437951, -175.72778425823611315 31.30369873179363793, -176.27520866730711191 31.83088711396169757, -177.04996373497760942 31.60978833477749461))') AS geom)" \
"UPDATE political SET geom = ST_Difference(political.geom, handdrawn.geom) FROM handdrawn WHERE mrgid_eez = 8453;" | exec_psql
# Set Navassa Island to United States Minor Outlying Islands
echo "UPDATE political SET iso_ter2 = 'UMI' WHERE mrgid_eez = 48951;";

# Remove Antarctica EEZ, based on advice from VLIZ etc (emails with Tim Hirsch, 2019-02-19).
echo "UPDATE political SET geom = ST_Multi(ST_Difference(political.geom, iho.geom)) FROM iho WHERE iso_ter1 = 'ATA' AND name = 'South Atlantic Ocean';" | exec_psql
echo "UPDATE political SET geom = ST_Multi(ST_Difference(political.geom, iho.geom)) FROM iho WHERE iso_ter1 = 'ATA' AND name = 'Southern Ocean';" | exec_psql
Expand Down Expand Up @@ -274,7 +285,7 @@ function import_political() {
# France considers the Tromelin Island part of the French Southern and Antarctic Lands
echo "UPDATE political SET iso_ter1 = 'ATF' WHERE mrgid_eez = 48946;" | exec_psql
# And the Matthew and Hunter Islands part of New Caledonia
echo "UPDATE political SET iso_ter1 = 'ATF' WHERE mrgid_eez = 48948;" | exec_psql
echo "UPDATE political SET iso_ter1 = 'NCL' WHERE mrgid_eez = 48948;" | exec_psql

# Note the areas having overlapping claims of some form, particularly these which include land:
#
Expand All @@ -291,10 +302,10 @@ function import_political() {
# Glorioso Islands │ MDG │ ATF │ ␀
# Hala'ib Triangle │ SDN │ EGY │ ␀
# Kuril Islands │ JPN │ RUS │ ␀
# Matthew and Hunter Islands │ ATF │ VUT │ ␀
# Matthew and Hunter Islands │ NCL │ VUT │ ␀
# Mayotte │ MYT │ COM │ ␀
# Melilla │ ESP │ MAR │ ␀
# Navassa Island │ HTI │ USA │ JAM
# Navassa Island │ HTI │ UMI │ JAM
# Overlapping claim: Kenya / Somalia │ KEN │ SOM │ ␀
# Palestine │ PSE │ ISR │ ␀
# Perejil Island │ ESP │ MAR │ ␀
Expand Down
20 changes: 17 additions & 3 deletions geocode-ws/src/main/resources/public/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ layers['grid'] = new ol.layer.Tile({
visible: false,
});

layers['baselayer'] = new ol.layer.Tile({
title: 'Base map',
layers['baselayer-middle'] = new ol.layer.Tile({
title: 'Base map (Middle)',
type: 'Base',
source: new ol.source.TileImage({
projection: 'EPSG:4326',
Expand All @@ -235,6 +235,19 @@ layers['baselayer'] = new ol.layer.Tile({
}),
});

layers['baselayer-geyser'] = new ol.layer.Tile({
title: 'Base map (Geyser)',
type: 'Base',
source: new ol.source.TileImage({
projection: 'EPSG:4326',
tileGrid: tileGrid,
url: 'https://tile.gbif.org/4326/omt/{z}/{x}/{y}@{r}x.png?style=gbif-geyser'.replace('{r}', pixel_ratio),
tilePixelRatio: pixel_ratio,
wrapX: false
}),
visible: false,
});

layers['baselayer-labels'] = new ol.layer.Tile({
title: 'Base map (labelled)',
type: 'Base',
Expand Down Expand Up @@ -467,7 +480,8 @@ var map = new ol.Map({
title: 'Base',
layers: [
layers['baselayer-osm'],
layers['baselayer'],
layers['baselayer-geyser'],
layers['baselayer-middle'],
layers['baselayer-labels']
]
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,19 @@ public void basicTest() {
testCountry("Ocean by Saint Barthélemy", 18, -62.5, SAINT_BARTHÉLEMY);
testCountry("New Caledonia", -20.98, 165.12, NEW_CALEDONIA);
testCountry("Ocean by New Caledonia", -20.16, 165.36, NEW_CALEDONIA);
testCountry("Matthew Island", -22.35, 171.35, NEW_CALEDONIA, VANUATU);
testCountry("Hunter Island", -22.4, 172.083333, NEW_CALEDONIA, VANUATU);
// The French Southern and Antarctic Lands
testCountry("Europa Island", -22.366667, 40.366667, FRENCH_SOUTHERN_TERRITORIES);
testCountry("Bassas da India", -21.483333, 39.683333, FRENCH_SOUTHERN_TERRITORIES);
testCountry("Juan de Nova Island", -17.055556, 42.725, FRENCH_SOUTHERN_TERRITORIES);
// These are the "Scattered Islands in the Indian Ocean": https://en.wikipedia.org/wiki/Scattered_Islands_in_the_Indian_Ocean
testCountry("Glorioso Islands", -11.55, 47.333333, MADAGASCAR, FRENCH_SOUTHERN_TERRITORIES); // Possibly TF ought to be before MG here.
testCountry("Tromelin Island", -15.892222, 54.524722, FRENCH_SOUTHERN_TERRITORIES, MADAGASCAR, MAURITIUS);
// Possibly TF ought to be before MG here.
testCountry("Glorioso Islands", -11.55, 47.333333, MADAGASCAR, FRENCH_SOUTHERN_TERRITORIES);
testCountry("Juan de Nova Island", -17.055556, 42.725, FRENCH_SOUTHERN_TERRITORIES);
testCountry("Bassas da India", -21.483333, 39.683333, FRENCH_SOUTHERN_TERRITORIES);
testCountry("Europa Island", -22.366667, 40.366667, FRENCH_SOUTHERN_TERRITORIES);
// These are the others: https://en.wikipedia.org/wiki/French_Southern_and_Antarctic_Lands#Administration
testCountry("Crozet Islands", -46.38, 51.67, FRENCH_SOUTHERN_TERRITORIES);
testCountry("Kerguelen Islands", -49.25, 69.166667, FRENCH_SOUTHERN_TERRITORIES);
testCountry("Saint Paul and Amsterdam Islands", -38.2694, 77.5417, FRENCH_SOUTHERN_TERRITORIES);

// Taiwan / Chinese Taipei
testCountry("臺北市, Taiwan", 25.05, 121.54, TAIWAN);
Expand All @@ -141,6 +147,18 @@ public void basicTest() {
testCountry("Laâyoune, Western Sahara, Morocco", 27.15, -13.20, WESTERN_SAHARA, MOROCCO);
testCountry("Ocean west of Western Sahara, Morocco", 26.85, -13.65, WESTERN_SAHARA, MOROCCO);

// United States Minor Outlying Islands: https://en.wikipedia.org/wiki/United_States_Minor_Outlying_Islands
// https://en.wikipedia.org/wiki/ISO_3166-2:UM
testCountry("Midway Atoll", 28.2075, -177.35, UNITED_STATES_OUTLYING_ISLANDS);
testCountry("Wake Island", 19.295278, 166.631111, UNITED_STATES_OUTLYING_ISLANDS);
testCountry("Johnston Atoll", 16.736944, -169.523889, UNITED_STATES_OUTLYING_ISLANDS);
testCountry("Kingman Reef", 6.383333, -162.416667, UNITED_STATES_OUTLYING_ISLANDS);
testCountry("Palmyra Atoll", 5.883611, -162.078333, UNITED_STATES_OUTLYING_ISLANDS);
testCountry("Howland Island", 0.807178, -176.616522, UNITED_STATES_OUTLYING_ISLANDS);
testCountry("Baker Island", 0.195833, -176.479167, UNITED_STATES_OUTLYING_ISLANDS);
testCountry("Jarvis Island", -0.366667, -160, UNITED_STATES_OUTLYING_ISLANDS);
testCountry("Navassa Island", 18.402778, -75.0125, HAITI, UNITED_STATES_OUTLYING_ISLANDS, JAMAICA);

// See also, https://en.wikipedia.org/wiki/List_of_states_with_limited_recognition
}

Expand Down

0 comments on commit 4f8649c

Please sign in to comment.