From 9e05101b126d15cc468e10b9101f53060761712e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Karla=C5=A1?= Date: Mon, 14 Jul 2025 15:13:24 +0200 Subject: [PATCH 1/3] [Divisions] Add support for Geographical Regions There are many regions in the world that people often search and some apps might want to highlight on map when searched for. --- .../division/bad-geographical-region.yaml | 20 ++ .../division_area/missing-properties.yaml | 2 +- docs/schema/reference/divisions/division.mdx | 17 + .../division/geographical_region.yaml | 17 + .../division_area/geographical_region.yaml | 311 ++++++++++++++++++ schema/divisions/defs.yaml | 6 + schema/divisions/division.yaml | 19 +- schema/divisions/division_area.yaml | 9 +- 8 files changed, 398 insertions(+), 3 deletions(-) create mode 100644 counterexamples/divisions/division/bad-geographical-region.yaml create mode 100644 examples/divisions/division/geographical_region.yaml create mode 100644 examples/divisions/division_area/geographical_region.yaml diff --git a/counterexamples/divisions/division/bad-geographical-region.yaml b/counterexamples/divisions/division/bad-geographical-region.yaml new file mode 100644 index 000000000..a974f90a1 --- /dev/null +++ b/counterexamples/divisions/division/bad-geographical-region.yaml @@ -0,0 +1,20 @@ +--- +id: counterexample:division:bad-geographical-region +type: Feature +geometry: + type: Point + coordinates: [0, 0] +properties: + theme: divisions + type: division + version: 0 + subtype: geographical_region + class: invalid_class + names: + primary: A division with an invalid class. + hierarchies: + - - division_id: counterexample:bad-geographical-region + subtype: geographical_region + name: A division with an invalid class. + ext_expected_errors: + - value must be one of 'megacity', 'city', 'town', 'village', 'hamlet', 'disputed', 'region', 'former_administrative_division' diff --git a/counterexamples/divisions/division_area/missing-properties.yaml b/counterexamples/divisions/division_area/missing-properties.yaml index 376fe9ef2..3cdc101cd 100644 --- a/counterexamples/divisions/division_area/missing-properties.yaml +++ b/counterexamples/divisions/division_area/missing-properties.yaml @@ -9,4 +9,4 @@ properties: type: division_area version: 0 ext_expected_errors: - - " missing properties 'names', 'subtype', 'class', 'country', 'division_id'" + - " missing properties 'names', 'subtype', 'class', 'division_id'" diff --git a/docs/schema/reference/divisions/division.mdx b/docs/schema/reference/divisions/division.mdx index 3062fe56c..3b81af7ce 100644 --- a/docs/schema/reference/divisions/division.mdx +++ b/docs/schema/reference/divisions/division.mdx @@ -53,6 +53,7 @@ Currently, the following subtypes are available in the `division` feature type: - `macrohood` - `neighborhood` - `microhood` +- `geographical_region` @@ -190,6 +191,22 @@ A microhood is a mini-neighborhood that is contained within a neighborhood. Exam + + + + + + + + +
subtypegeographical_region
+ + +A geographical region that is not administrative. Examples: Middle east, Appalachia, Baltics, Intermediate and Immediate geographic regions in Brazil, Snowbelt, Caribbean, etc. + +
+ + ## Schema diff --git a/examples/divisions/division/geographical_region.yaml b/examples/divisions/division/geographical_region.yaml new file mode 100644 index 000000000..47216a58a --- /dev/null +++ b/examples/divisions/division/geographical_region.yaml @@ -0,0 +1,17 @@ +--- +id: example:division:middle_east +type: Feature +geometry: + type: Point + coordinates: [-100.4458820, 39.7837304] +properties: + theme: divisions + type: division + version: 0 + subtype: geographical_region + names: + primary: Middle East + hierarchies: + - - division_id: example:division:middle_east + subtype: geographical_region + name: Middle East diff --git a/examples/divisions/division_area/geographical_region.yaml b/examples/divisions/division_area/geographical_region.yaml new file mode 100644 index 000000000..d918d41de --- /dev/null +++ b/examples/divisions/division_area/geographical_region.yaml @@ -0,0 +1,311 @@ +--- +id: example:division_area:middle_east +type: Feature +geometry: + type: MultiPolygon + coordinates: [ + [ + [ + [-170.6290015, 25.3053671], + [-170.4076134, 25.5082632], + [-170.6300336, 25.7076006], + [-170.8506754, 25.5056948], + [-170.6290015, 25.3053671] + ] + ], + [ + [ + [-171.7380245, 25.555318], + [-171.4949943, 25.7747795], + [-171.726725, 25.9865667], + [-171.9674222, 25.7845748], + [-171.7380245, 25.555318] + ] + ], + [ + [ + [-174.0155727, 25.8411597], + [-173.7437151, 26.0119599], + [-173.905507, 26.2639004], + [-174.2280618, 26.0816774], + [-174.0155727, 25.8411597] + ] + ], + [ + [ + [-175.9506918, 27.5543172], + [-175.5545765, 27.7281369], + [-175.6295776, 28.1237431], + [-176.1866168, 27.9330153], + [-175.9506918, 27.5543172] + ] + ], + [ + [ + [-166.1182936, 23.4254685], + [-165.8702478, 23.8636297], + [-166.3767961, 24.0561939], + [-166.5303209, 23.7815879], + [-166.1182936, 23.4254685] + ] + ], + [ + [ + [-167.9975573, 24.7968943], + [-167.778217, 25.0023686], + [-168.005803, 25.20088], + [-168.2206497, 24.9967937], + [-167.9975573, 24.7968943] + ] + ], + [ + [ + [-157.4082814, 55.576068], + [-157.1024297, 55.6733491], + [-157.0908436, 55.8696588], + [-157.7232999, 55.870247], + [-157.4082814, 55.576068] + ] + ], + [ + [ + [-155.6071465, 55.55087], + [-155.2980807, 56.0385909], + [-156.1270413, 55.9006965], + [-156.0182299, 55.6525826], + [-155.6071465, 55.55087] + ] + ], + [ + [ + [-178.3063127, 28.1837783], + [-178.0577766, 28.4309636], + [-178.3589518, 28.655272], + [-178.60056, 28.4012455], + [-178.3063127, 28.1837783] + ] + ], + [ + [ + [-179.1390989, 51.0070029], + [-173.0611771, 51.8159234], + [-171.9740685, 52.3514335], + [-178.9229631, 52.0275532], + [-179.1390989, 51.0070029] + ] + ], + [ + [ + [-180, 51.7940888], + [-179.8836979, 51.9764894], + [-180, 52.138489], + [-180, 51.8434509], + [-180, 51.7940888] + ] + ], + [ + [ + [-170.3952428, 56.8431693], + [-169.6956679, 57.0307607], + [-169.5801239, 57.2365744], + [-170.6525321, 57.3494254], + [-170.3952428, 56.8431693] + ] + ], + [ + [ + [-169.5771945, 56.3323838], + [-169.1322924, 56.6737641], + [-170.1288343, 56.6777795], + [-170.0250438, 56.4580184], + [-169.5771945, 56.3323838] + ] + ], + [ + [ + [-168.0561273, 64.76067], + [-167.5930406, 65.0286657], + [-168.5591053, 65.007885], + [-168.4482776, 64.8327172], + [-168.0561273, 64.76067] + ] + ], + [ + [ + [-156.6720152, 20.3000654], + [-155.800111, 20.8826396], + [-158.455088, 21.6943824], + [-158.2462379, 21.1430868], + [-156.6720152, 20.3000654] + ] + ], + [ + [ + [-160.5398128, 21.4482644], + [-159.3028431, 21.7124132], + [-159.1241278, 22.2798801], + [-160.2161715, 22.1993854], + [-160.5398128, 21.4482644] + ] + ], + [ + [ + [-161.9236658, 22.8550496], + [-161.6972866, 23.0665997], + [-161.9360903, 23.2652845], + [-162.1455351, 23.0568827], + [-161.9236658, 22.8550496] + ] + ], + [ + [ + [-164.7000199, 23.3734366], + [-164.4760626, 23.575844], + [-164.7056774, 23.7796906], + [-164.9238496, 23.5726775], + [-164.7000199, 23.3734366] + ] + ], + [ + [ + [-155.6810194, 18.7091718], + [-154.595509, 19.5434371], + [-155.877534, 20.4681176], + [-156.2732568, 19.7049213], + [-155.6810194, 18.7091718] + ] + ], + [ + [ + [-82.8732511, 24.4116731], + [-82.5948517, 24.5902399], + [-82.7300073, 24.8395704], + [-83.153058, 24.6776636], + [-82.8732511, 24.4116731] + ] + ], + [ + [ + [-81.8773353, 24.2520071], + [-68.1545602, 47.3251568], + [-82.6797222, 41.6765556], + [-84.129, 46.5305], + [-94.9573889, 49.3701944], + [-125.0271096, 48.4630615], + [-119.6795205, 33.0665347], + [-97.40561, 25.83764], + [-84.0549877, 29.8627705], + [-81.8773353, 24.2520071] + ] + ], + [ + [ + [179.2356588, 51.1468561], + [178.6498473, 52.169477], + [176.8813625, 51.9348227], + [177.1853792, 51.6303915], + [179.2356588, 51.1468561] + ] + ], + [ + [ + [179.6302237, 51.6862391], + [180, 52.1384488], + [179.2193828, 52.1042624], + [179.2227021, 51.833522], + [179.6302237, 51.6862391] + ] + ], + [ + [ + [175.915408, 52.1325238], + [176.2623207, 52.4572425], + [175.5671255, 52.4969017], + [175.5586568, 52.2829505], + [175.915408, 52.1325238] + ] + ], + [ + [ + [173.6474085, 52.1472948], + [174.8392132, 52.6878183], + [172.1158739, 52.9881155], + [173.132385, 52.2506975], + [173.6474085, 52.1472948] + ] + ], + [ + [ + [-146.3855284, 59.1843829], + [-145.9234279, 59.3169728], + [-145.8952803, 59.5345003], + [-146.6535985, 59.6545361], + [-146.3855284, 59.1843829] + ] + ], + [ + [ + [-171.2797217, 52.2444061], + [-145.9885379, 60.1761058], + [-130.003485, 56.008075], + [-141.00198, 60.3063692], + [-140.7523256, 69.8283004], + [-156.6515529, 71.581159], + [-169.0485821, 65.4690061], + [-161.2500247, 63.8004626], + [-167.6542464, 59.9434356], + [-158.0753114, 57.7475562], + [-171.2797217, 52.2444061] + ], + [ + [-153.8125943, 58.0958144], + [-153.5773523, 58.3547948], + [-153.3559904, 58.4231127], + [-153.6200524, 58.260124], + [-153.8125943, 58.0958144] + ], + [ + [-153.1820044, 58.5355625], + [-153.1751501, 58.5480609], + [-153.1384992, 58.5678286], + [-153.1470249, 58.5552926], + [-153.1820044, 58.5355625] + ], + [ + [-152.8741566, 58.7660471], + [-152.9882543, 59.4696836], + [-152.1322999, 60.0079718], + [-152.330171, 59.1676267], + [-152.8741566, 58.7660471] + ] + ], + [ + [ + [-172.7696055, 59.9963072], + [-171.8272619, 60.3517559], + [-173.4406927, 60.7880772], + [-173.4413238, 60.4223353], + [-172.7696055, 59.9963072] + ] + ], + [ + [ + [-169.6463302, 62.736964], + [-168.2509717, 63.332816], + [-172.2753008, 63.6094455], + [-172.0058757, 63.2057208], + [-169.6463302, 62.736964] + ] + ] + ] +properties: + theme: divisions + type: division_area + version: 0 + subtype: geographical_region + class: land + is_land: true + is_territorial: true + division_id: example:division:middle_east + names: + primary: Middle East \ No newline at end of file diff --git a/schema/divisions/defs.yaml b/schema/divisions/defs.yaml index 4b3e3ec5d..b5ce7548b 100644 --- a/schema/divisions/defs.yaml +++ b/schema/divisions/defs.yaml @@ -57,6 +57,12 @@ description: Common schema definitions for divisions theme - microhood # A mini-neighborhood that is contained within a # division of type neighborhood. + + - geographical_region # A geographical region that is not administrative. + # e.g. Middle east, Appalachia, Baltics, + # Intermediate and Immediate geographic regions in Brazil, + # Snowbelt, Caribbean, etc. + hierarchy: description: A hierarchy of divisions, with the first entry being a country; diff --git a/schema/divisions/division.yaml b/schema/divisions/division.yaml index f4eb4d008..4d1315b98 100644 --- a/schema/divisions/division.yaml +++ b/schema/divisions/division.yaml @@ -30,7 +30,14 @@ properties: # JSON Schema: Top-level object properties. required: [names, subtype, country, hierarchies] not: { required: [parent_division_id] } else: - required: [names, subtype, country, hierarchies, parent_division_id] + if: + properties: + subtype: { enum: [geographical_region] } + then: + required: [names, subtype, hierarchies] + not: { required: [country, parent_division_id] } + else: + required: [names, subtype, country, hierarchies, parent_division_id] properties: # JSON Schema: properties within GeoJSON top-level object 'properties' property subtype: { "$ref": "./defs.yaml#/$defs/propertyDefinitions/placetype" } class: @@ -52,6 +59,16 @@ properties: # JSON Schema: Top-level object properties. - hamlet #A small, isolated human settlement in a rural area #Example: Tjarnabyggð, Iceland. + + - disputed #A geographical region that is claimed by multiple countries or entities, + #and is not universally recognized as belonging to any one of them. + #Example: Bir Tawil. + + - region #A general geographical region. + #Example: Middle east. + - former_administrative_division # A division that no longer exists, but is still relevant as people + # often search for it. + # Example: Sogn og Fjordane, Norway. local_type: description: Local name for the subtype property, optionally localized. diff --git a/schema/divisions/division_area.yaml b/schema/divisions/division_area.yaml index 985bdd60d..a379bc693 100644 --- a/schema/divisions/division_area.yaml +++ b/schema/divisions/division_area.yaml @@ -22,10 +22,17 @@ properties: # JSON Schema: Top-level object properties. - "$ref": https://geojson.org/schema/MultiPolygon.json properties: # GeoJSON: top-level object 'properties' property. unevaluatedProperties: false - required: [names, subtype, class, country, division_id, is_land, is_territorial] allOf: - "$ref": ../defs.yaml#/$defs/propertyContainers/overtureFeaturePropertiesContainer - "$ref": ../defs.yaml#/$defs/propertyContainers/namesContainer + - if: + properties: + subtype: { enum: [geographical_region] } + then: + required: [names, subtype, class, division_id, is_land, is_territorial] + not: { required: [country] } + else: + required: [names, subtype, class, country, division_id, is_land, is_territorial] anyOf: - properties: is_land: From 0709a7e0400d9e9e6b9c23776cdf68105fb95445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Karla=C5=A1?= Date: Tue, 22 Jul 2025 09:43:27 +0200 Subject: [PATCH 2/3] Remove former_administrative_division class This needs more considiration --- .../divisions/division/bad-geographical-region.yaml | 2 +- schema/divisions/division.yaml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/counterexamples/divisions/division/bad-geographical-region.yaml b/counterexamples/divisions/division/bad-geographical-region.yaml index a974f90a1..3a4f5c9f0 100644 --- a/counterexamples/divisions/division/bad-geographical-region.yaml +++ b/counterexamples/divisions/division/bad-geographical-region.yaml @@ -17,4 +17,4 @@ properties: subtype: geographical_region name: A division with an invalid class. ext_expected_errors: - - value must be one of 'megacity', 'city', 'town', 'village', 'hamlet', 'disputed', 'region', 'former_administrative_division' + - value must be one of 'megacity', 'city', 'town', 'village', 'hamlet', 'disputed', 'region' diff --git a/schema/divisions/division.yaml b/schema/divisions/division.yaml index 4d1315b98..cc54e9c74 100644 --- a/schema/divisions/division.yaml +++ b/schema/divisions/division.yaml @@ -66,9 +66,6 @@ properties: # JSON Schema: Top-level object properties. - region #A general geographical region. #Example: Middle east. - - former_administrative_division # A division that no longer exists, but is still relevant as people - # often search for it. - # Example: Sogn og Fjordane, Norway. local_type: description: Local name for the subtype property, optionally localized. From 094861192395d166102bc40cd84933a6dfc9a96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Karla=C5=A1?= Date: Tue, 22 Jul 2025 10:07:04 +0200 Subject: [PATCH 3/3] Fix docs --- docs/schema/reference/divisions/division.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/schema/reference/divisions/division.mdx b/docs/schema/reference/divisions/division.mdx index 3b81af7ce..bf31c1016 100644 --- a/docs/schema/reference/divisions/division.mdx +++ b/docs/schema/reference/divisions/division.mdx @@ -189,7 +189,6 @@ A neighborhood is a geographically localized community within a city, town, subu A microhood is a mini-neighborhood that is contained within a neighborhood. Example: Gätjensort in Hamburg -