diff --git a/tests/data/geojson/Feature02-MultiPolygon.json b/tests/data/geojson/Feature02-MultiPolygon.json index 7a4ca69c..a4bdc24a 100644 --- a/tests/data/geojson/Feature02-MultiPolygon.json +++ b/tests/data/geojson/Feature02-MultiPolygon.json @@ -1,57 +1,15 @@ { "type": "Feature", - "properties": { - "id": "f1", - "name": "first", - "pop": 1234 - }, + "properties": {"id": "f1", "name": "first", "pop": 1234}, "geometry": { "type": "MultiPolygon", "coordinates": [ [ - [ - [ - 5.1, - 51.22 - ], - [ - 5.11, - 51.23 - ], - [ - 5.14, - 51.21 - ], - [ - 5.12, - 51.2 - ], - [ - 5.1, - 51.22 - ] - ] + [[5.1, 51.22], [5.11, 51.23], [5.14, 51.21], [5.12, 51.2], [5.1, 51.22]] ], [ - [ - [ - 5.12, - 51.23 - ], - [ - 5.13, - 51.24 - ], - [ - 5.14, - 51.22 - ], - [ - 5.12, - 51.23 - ] - ] + [[5.12, 51.23], [5.13, 51.24], [5.14, 51.22], [5.12, 51.23]] ] ] } -} \ No newline at end of file +} diff --git a/tests/data/geojson/FeatureCollection01.json b/tests/data/geojson/FeatureCollection01.json index 247d03ee..dcf64044 100644 --- a/tests/data/geojson/FeatureCollection01.json +++ b/tests/data/geojson/FeatureCollection01.json @@ -8,26 +8,11 @@ "type": "Polygon", "coordinates": [ [ - [ - 4.47, - 51.1 - ], - [ - 4.52, - 51.1 - ], - [ - 4.52, - 51.15 - ], - [ - 4.47, - 51.15 - ], - [ - 4.47, - 51.1 - ] + [4.47, 51.1], + [4.52, 51.1], + [4.52, 51.15], + [4.47, 51.15], + [4.47, 51.1] ] ] } @@ -39,26 +24,11 @@ "type": "Polygon", "coordinates": [ [ - [ - 4.45, - 51.17 - ], - [ - 4.5, - 51.17 - ], - [ - 4.5, - 51.2 - ], - [ - 4.45, - 51.2 - ], - [ - 4.45, - 51.17 - ] + [4.45, 51.17], + [4.5, 51.17], + [4.5, 51.2], + [4.45, 51.2], + [4.45, 51.17] ] ] } diff --git a/tests/data/geojson/FeatureCollection03.json b/tests/data/geojson/FeatureCollection03.json index a40d6537..adbc6a77 100644 --- a/tests/data/geojson/FeatureCollection03.json +++ b/tests/data/geojson/FeatureCollection03.json @@ -1,175 +1,89 @@ { - "type": "FeatureCollection", - "name": "2016 narrow TEST Fields Belgium", - "crs": { - "type": "name", - "properties": { - "name": "urn:ogc:def:crs:EPSG::31370" - } + "type": "FeatureCollection", + "name": "2016 narrow TEST Fields Belgium", + "crs": { + "type": "name", + "properties": {"name": "urn:ogc:def:crs:EPSG::31370"} + }, + "features": [ + { + "type": "Feature", + "properties": { + "fid": 1734, + "CODE_OBJ": "000028025D981557", + "CMP_COD": "2016" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [236946.3, 171498.69], + [236967.97, 171515.54], + [236973.44, 171519.42], + [236980.3, 171524.28], + [236986.37, 171529.15], + [236995.55, 171536.08], + [237042.98, 171457.76], + [237022, 171445], + [237014.5, 171439.75], + [236996, 171428.75], + [236944.82, 171497.48], + [236946.3, 171498.69] + ] + ] + ] + } }, - "features": [ - { - "type": "Feature", - "properties": { - "fid": 1734, - "CODE_OBJ": "000028025D981557", - "CMP_COD": "2016" - }, - "geometry": { - "type": "MultiPolygon", - "coordinates": [ - [ - [ - [ - 236946.3, - 171498.69 - ], - [ - 236967.97, - 171515.54 - ], - [ - 236973.44, - 171519.42 - ], - [ - 236980.3, - 171524.28 - ], - [ - 236986.37, - 171529.15 - ], - [ - 236995.55, - 171536.08 - ], - [ - 237042.98, - 171457.76 - ], - [ - 237022.0, - 171445.0 - ], - [ - 237014.5, - 171439.75 - ], - [ - 236996.0, - 171428.75 - ], - [ - 236944.82, - 171497.48 - ], - [ - 236946.3, - 171498.69 - ] - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "fid": 33591, - "CODE_OBJ": "000028025EF051D8", - "CMP_COD": "2016" - }, - "geometry": { - "type": "MultiPolygon", - "coordinates": [ - [ - [ - [ - 236497.33, - 171983.0 - ], - [ - 236738.0, - 172064.66 - ], - [ - 236751.5, - 172027.5 - ], - [ - 236507.85, - 171945.94 - ], - [ - 236506.04, - 171952.44 - ], - [ - 236503.97, - 171959.87 - ], - [ - 236500.03, - 171973.26 - ], - [ - 236498.43, - 171978.72 - ], - [ - 236497.33, - 171983.0 - ] - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "fid": 33594, - "CODE_OBJ": "0000280260D5544B", - "CMP_COD": "2016" - }, - "geometry": { - "type": "MultiPolygon", - "coordinates": [ - [ - [ - [ - 236676.5, - 171730.75 - ], - [ - 236835.5, - 171784.75 - ], - [ - 236837.5, - 171783.0 - ], - [ - 236866.46, - 171750.58 - ], - [ - 236705.6, - 171695.95 - ], - [ - 236694.61, - 171710.12 - ], - [ - 236676.5, - 171730.75 - ] - ] - ] - ] - } - } - ] + { + "type": "Feature", + "properties": { + "fid": 33591, + "CODE_OBJ": "000028025EF051D8", + "CMP_COD": "2016" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [236497.33, 171983], + [236738, 172064.66], + [236751.5, 172027.5], + [236507.85, 171945.94], + [236506.04, 171952.44], + [236503.97, 171959.87], + [236500.03, 171973.26], + [236498.43, 171978.72], + [236497.33, 171983] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fid": 33594, + "CODE_OBJ": "0000280260D5544B", + "CMP_COD": "2016" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [236676.5, 171730.75], + [236835.5, 171784.75], + [236837.5, 171783], + [236866.46, 171750.58], + [236705.6, 171695.95], + [236694.61, 171710.12], + [236676.5, 171730.75] + ] + ] + ] + } + } + ] } diff --git a/tests/data/geojson/FeatureCollection04.json b/tests/data/geojson/FeatureCollection04.json index 45890eeb..326ede8b 100644 --- a/tests/data/geojson/FeatureCollection04.json +++ b/tests/data/geojson/FeatureCollection04.json @@ -1,297 +1,106 @@ { - "type": "FeatureCollection", - "name": "ref_fields_harvest_detector", - "crs": { - "type": "name", - "properties": { - "name": "urn:ogc:def:crs:OGC:1.3:CRS84" - } + "type": "FeatureCollection", + "name": "ref_fields_harvest_detector", + "crs": { + "type": "name", + "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"} + }, + "features": [ + { + "type": "Feature", + "properties": {"CODE_OBJ": "00002808654583BD"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [5.015410659755014, 51.1749941804753], + [5.016929803651372, 51.17561722437745], + [5.017476812379938, 51.174900410668265], + [5.01695370426541, 51.17469294559212], + [5.017138866976332, 51.17450657733387], + [5.016304886575674, 51.17418539995633], + [5.015410659755014, 51.1749941804753] + ] + ] + } }, - "features": [ - { - "type": "Feature", - "properties": { - "CODE_OBJ": "00002808654583BD" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 5.015410659755014, - 51.174994180475302 - ], - [ - 5.016929803651372, - 51.175617224377447 - ], - [ - 5.017476812379938, - 51.174900410668265 - ], - [ - 5.01695370426541, - 51.17469294559212 - ], - [ - 5.017138866976332, - 51.174506577333872 - ], - [ - 5.016304886575674, - 51.174185399956329 - ], - [ - 5.015410659755014, - 51.174994180475302 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "CODE_OBJ": "0000280862FE3856" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 5.014235318126361, - 51.17550731951949 - ], - [ - 5.015387559842375, - 51.176978513036197 - ], - [ - 5.01563666308942, - 51.177039710262655 - ], - [ - 5.015642689990128, - 51.177041205331285 - ], - [ - 5.015647308982032, - 51.17703398890518 - ], - [ - 5.016280819993641, - 51.176365067234684 - ], - [ - 5.016297330095693, - 51.176369740738025 - ], - [ - 5.016939007396039, - 51.175620949149859 - ], - [ - 5.015410659755014, - 51.174994180475302 - ], - [ - 5.015389752047644, - 51.175012632386427 - ], - [ - 5.015368453271792, - 51.175013198553714 - ], - [ - 5.015281256350187, - 51.175015474153355 - ], - [ - 5.014836281127843, - 51.174832111262226 - ], - [ - 5.014721082331196, - 51.174867169432176 - ], - [ - 5.014646104849949, - 51.174905063541786 - ], - [ - 5.014554240722759, - 51.175055590871537 - ], - [ - 5.014447256108486, - 51.175250156507772 - ], - [ - 5.01434658113913, - 51.17538410243003 - ], - [ - 5.014267866790361, - 51.175472354478764 - ], - [ - 5.014235318126361, - 51.17550731951949 - ] - ], - [ - [ - 5.01441223307144, - 51.175343922443311 - ], - [ - 5.01448242756633, - 51.175342639426802 - ], - [ - 5.014486952993698, - 51.175390615300394 - ], - [ - 5.014459500579303, - 51.175390855424041 - ], - [ - 5.014414175933029, - 51.175391283229324 - ], - [ - 5.01441223307144, - 51.175343922443311 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "CODE_OBJ": "000028084F9B8C1A" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 5.01486654560115, - 51.174828439873814 - ], - [ - 5.015368453271792, - 51.175013198553714 - ], - [ - 5.016057124268833, - 51.174394852250636 - ], - [ - 5.01668139945403, - 51.173866924023201 - ], - [ - 5.016596524878367, - 51.173830355843783 - ], - [ - 5.016596380646481, - 51.173830266746791 - ], - [ - 5.016595949199724, - 51.173830089337905 - ], - [ - 5.016595374769976, - 51.173829912714119 - ], - [ - 5.01658803767789, - 51.173826716998846 - ], - [ - 5.016152163744225, - 51.173670185829295 - ], - [ - 5.016154666291308, - 51.17366504842979 - ], - [ - 5.016108966987549, - 51.173648669723825 - ], - [ - 5.016010506352376, - 51.173766425037606 - ], - [ - 5.015789630310915, - 51.174048179766764 - ], - [ - 5.015695615938525, - 51.174177326297809 - ], - [ - 5.015519458801282, - 51.174126695821251 - ], - [ - 5.015360272605526, - 51.174083073302249 - ], - [ - 5.015341182419055, - 51.174119133475273 - ], - [ - 5.015289229869719, - 51.174239599608761 - ], - [ - 5.015200888401407, - 51.17444799663253 - ], - [ - 5.015117916045672, - 51.174651779824778 - ], - [ - 5.015100541267102, - 51.17468783055169 - ], - [ - 5.015083073011596, - 51.174717140122468 - ], - [ - 5.015044219156725, - 51.174751061274257 - ], - [ - 5.015017761126847, - 51.174771431188731 - ], - [ - 5.014973380276639, - 51.174798640923839 - ], - [ - 5.014943285250912, - 51.174814536297099 - ], - [ - 5.01486654560115, - 51.174828439873814 - ] - ] - ] - } - } - ] + { + "type": "Feature", + "properties": {"CODE_OBJ": "0000280862FE3856"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [5.014235318126361, 51.17550731951949], + [5.015387559842375, 51.1769785130362], + [5.01563666308942, 51.177039710262655], + [5.015642689990128, 51.177041205331285], + [5.015647308982032, 51.17703398890518], + [5.016280819993641, 51.176365067234684], + [5.016297330095693, 51.176369740738025], + [5.016939007396039, 51.17562094914986], + [5.015410659755014, 51.1749941804753], + [5.015389752047644, 51.17501263238643], + [5.015368453271792, 51.175013198553714], + [5.015281256350187, 51.175015474153355], + [5.014836281127843, 51.174832111262226], + [5.014721082331196, 51.174867169432176], + [5.014646104849949, 51.174905063541786], + [5.014554240722759, 51.17505559087154], + [5.014447256108486, 51.17525015650777], + [5.01434658113913, 51.17538410243003], + [5.014267866790361, 51.175472354478764], + [5.014235318126361, 51.17550731951949] + ], + [ + [5.01441223307144, 51.17534392244331], + [5.01448242756633, 51.1753426394268], + [5.014486952993698, 51.175390615300394], + [5.014459500579303, 51.17539085542404], + [5.014414175933029, 51.175391283229324], + [5.01441223307144, 51.17534392244331] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"CODE_OBJ": "000028084F9B8C1A"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [5.01486654560115, 51.174828439873814], + [5.015368453271792, 51.175013198553714], + [5.016057124268833, 51.174394852250636], + [5.01668139945403, 51.1738669240232], + [5.016596524878367, 51.17383035584378], + [5.016596380646481, 51.17383026674679], + [5.016595949199724, 51.173830089337905], + [5.016595374769976, 51.17382991271412], + [5.01658803767789, 51.173826716998846], + [5.016152163744225, 51.173670185829295], + [5.016154666291308, 51.17366504842979], + [5.016108966987549, 51.173648669723825], + [5.016010506352376, 51.173766425037606], + [5.015789630310915, 51.174048179766764], + [5.015695615938525, 51.17417732629781], + [5.015519458801282, 51.17412669582125], + [5.015360272605526, 51.17408307330225], + [5.015341182419055, 51.17411913347527], + [5.015289229869719, 51.17423959960876], + [5.015200888401407, 51.17444799663253], + [5.015117916045672, 51.17465177982478], + [5.015100541267102, 51.17468783055169], + [5.015083073011596, 51.17471714012247], + [5.015044219156725, 51.17475106127426], + [5.015017761126847, 51.17477143118873], + [5.014973380276639, 51.17479864092384], + [5.014943285250912, 51.1748145362971], + [5.01486654560115, 51.174828439873814] + ] + ] + } + } + ] } diff --git a/tests/data/geojson/FeatureCollection06.json b/tests/data/geojson/FeatureCollection06.json index 0e9d8a6c..47be5395 100644 --- a/tests/data/geojson/FeatureCollection06.json +++ b/tests/data/geojson/FeatureCollection06.json @@ -1,7 +1,6 @@ { "type": "FeatureCollection", "features": [ - { "type": "Feature", "properties": {}, @@ -9,29 +8,14 @@ "type": "Polygon", "coordinates": [ [ - [ - 3.67466926574707, - 51.037804967049205 - ], - [ - 3.70737075805664, - 51.037804967049205 - ], - [ - 3.70737075805664, - 51.05793176907366 - ], - [ - 3.67466926574707, - 51.05793176907366 - ], - [ - 3.67466926574707, - 51.037804967049205 - ] + [3.67466926574707, 51.037804967049205], + [3.70737075805664, 51.037804967049205], + [3.70737075805664, 51.05793176907366], + [3.67466926574707, 51.05793176907366], + [3.67466926574707, 51.037804967049205] ] ] } } ] -} \ No newline at end of file +} diff --git a/tests/data/geojson/FeatureCollection07.json b/tests/data/geojson/FeatureCollection07.json index aa7ed9f6..4ab35f95 100644 --- a/tests/data/geojson/FeatureCollection07.json +++ b/tests/data/geojson/FeatureCollection07.json @@ -8,26 +8,11 @@ "type": "Polygon", "coordinates": [ [ - [ - 3.77466926574707, - 51.037804967049205 - ], - [ - 3.80737075805664, - 51.037804967049205 - ], - [ - 3.80737075805664, - 51.05793176907366 - ], - [ - 3.77466926574707, - 51.05793176907366 - ], - [ - 3.77466926574707, - 51.037804967049205 - ] + [3.77466926574707, 51.037804967049205], + [3.80737075805664, 51.037804967049205], + [3.80737075805664, 51.05793176907366], + [3.77466926574707, 51.05793176907366], + [3.77466926574707, 51.037804967049205] ] ] } @@ -39,26 +24,11 @@ "type": "Polygon", "coordinates": [ [ - [ - 3.67466926574707, - 51.037804967049205 - ], - [ - 3.70737075805664, - 51.037804967049205 - ], - [ - 3.70737075805664, - 51.05793176907366 - ], - [ - 3.67466926574707, - 51.05793176907366 - ], - [ - 3.67466926574707, - 51.037804967049205 - ] + [3.67466926574707, 51.037804967049205], + [3.70737075805664, 51.037804967049205], + [3.70737075805664, 51.05793176907366], + [3.67466926574707, 51.05793176907366], + [3.67466926574707, 51.037804967049205] ] ] } diff --git a/tests/data/geojson/FeatureCollection08.json b/tests/data/geojson/FeatureCollection08.json index 4e46c303..4274dbd7 100644 --- a/tests/data/geojson/FeatureCollection08.json +++ b/tests/data/geojson/FeatureCollection08.json @@ -1,14 +1,25 @@ { "type": "FeatureCollection", "name": "FeatureCollections08", - "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:EPSG::32631"}}, + "crs": { + "type": "name", + "properties": {"name": "urn:ogc:def:crs:EPSG::32631"} + }, "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", - "coordinates": [[[547302.56209084216971, 5654245.511211921460927], [549595.312723760260269, 5654267.013290034607053], [549573.822855299571529, 5656505.172573580406606], [547282.065756102674641, 5656483.673708858899772], [547302.56209084216971, 5654245.511211921460927]]] + "coordinates": [ + [ + [547302.5620908422, 5654245.511211921], + [549595.3127237603, 5654267.013290035], + [549573.8228552996, 5656505.17257358], + [547282.0657561027, 5656483.673708859], + [547302.5620908422, 5654245.511211921] + ] + ] } } ] diff --git a/tests/data/geojson/FeatureCollection09.json b/tests/data/geojson/FeatureCollection09.json index 1f90fb9d..dd784312 100644 --- a/tests/data/geojson/FeatureCollection09.json +++ b/tests/data/geojson/FeatureCollection09.json @@ -1,8 +1,26 @@ { -"type": "FeatureCollection", -"name": "FeatureCollections09", -"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::32634" } }, -"features": [ -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 546500.734324475633912, 8998496.532106472179294 ], [ 547068.869181835558265, 8998522.909413514658809 ], [ 546964.038438386865892, 9000767.116470934823155 ], [ 546397.169007838820107, 9000740.796458588913083 ], [ 546500.734324475633912, 8998496.532106472179294 ] ] ] } } -] + "type": "FeatureCollection", + "name": "FeatureCollections09", + "crs": { + "type": "name", + "properties": {"name": "urn:ogc:def:crs:EPSG::32634"} + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [546500.7343244756, 8998496.532106472], + [547068.8691818356, 8998522.909413515], + [546964.0384383869, 9000767.116470935], + [546397.1690078388, 9000740.796458589], + [546500.7343244756, 8998496.532106472] + ] + ] + } + } + ] } diff --git a/tests/data/geojson/GeometryCollection01.json b/tests/data/geojson/GeometryCollection01.json index 2ad86c65..a69afe92 100644 --- a/tests/data/geojson/GeometryCollection01.json +++ b/tests/data/geojson/GeometryCollection01.json @@ -4,54 +4,18 @@ { "type": "Polygon", "coordinates": [ - [ - [ - 5.05, - 51.25 - ], - [ - 5.1, - 51.25 - ], - [ - 5.1, - 51.3 - ], - [ - 5.05, - 51.3 - ], - [ - 5.05, - 51.25 - ] - ] + [[5.05, 51.25], [5.1, 51.25], [5.1, 51.3], [5.05, 51.3], [5.05, 51.25]] ] }, { "type": "Polygon", "coordinates": [ [ - [ - 5.12, - 51.21 - ], - [ - 5.15, - 51.21 - ], - [ - 5.15, - 51.26 - ], - [ - 5.12, - 51.26 - ], - [ - 5.12, - 51.21 - ] + [5.12, 51.21], + [5.15, 51.21], + [5.15, 51.26], + [5.12, 51.26], + [5.12, 51.21] ] ] } diff --git a/tests/data/geojson/MultiPolygon01.json b/tests/data/geojson/MultiPolygon01.json index 63c42aea..ed5639c1 100644 --- a/tests/data/geojson/MultiPolygon01.json +++ b/tests/data/geojson/MultiPolygon01.json @@ -1,49 +1,7 @@ { "type": "MultiPolygon", "coordinates": [ - [ - [ - [ - 5.1, - 51.22 - ], - [ - 5.11, - 51.23 - ], - [ - 5.14, - 51.21 - ], - [ - 5.12, - 51.2 - ], - [ - 5.1, - 51.22 - ] - ] - ], - [ - [ - [ - 5.12, - 51.23 - ], - [ - 5.13, - 51.24 - ], - [ - 5.14, - 51.22 - ], - [ - 5.12, - 51.23 - ] - ] - ] + [[[5.1, 51.22], [5.11, 51.23], [5.14, 51.21], [5.12, 51.2], [5.1, 51.22]]], + [[[5.12, 51.23], [5.13, 51.24], [5.14, 51.22], [5.12, 51.23]]] ] -} \ No newline at end of file +} diff --git a/tests/data/geojson/Polygon01.json b/tests/data/geojson/Polygon01.json index cb69c683..34855928 100644 --- a/tests/data/geojson/Polygon01.json +++ b/tests/data/geojson/Polygon01.json @@ -1,27 +1,6 @@ { "type": "Polygon", "coordinates": [ - [ - [ - 5.1, - 51.22 - ], - [ - 5.11, - 51.23 - ], - [ - 5.14, - 51.21 - ], - [ - 5.12, - 51.2 - ], - [ - 5.1, - 51.22 - ] - ] + [[5.1, 51.22], [5.11, 51.23], [5.14, 51.21], [5.12, 51.2], [5.1, 51.22]] ] -} \ No newline at end of file +} diff --git a/tests/data/geojson/mol.json b/tests/data/geojson/mol.json index ad52bba7..3cae3d6b 100644 --- a/tests/data/geojson/mol.json +++ b/tests/data/geojson/mol.json @@ -1,8 +1,42 @@ { -"type": "FeatureCollection", -"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, -"features": [ -{ "type": "Feature", "properties": { "id": 23, "name": "Mol", "class": 4 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 5.099185309788365, 51.19128726234392 ], [ 5.11418113136547, 51.196949475430756 ], [ 5.126371845690255, 51.189132203507086 ], [ 5.117041764554222, 51.181488146097188 ], [ 5.097377985552487, 51.184446883422112 ], [ 5.099185309788365, 51.19128726234392 ] ] ] } }, -{ "type": "Feature", "properties": { "id": 58, "name": "TAP", "class": 5 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 5.07838044255931, 51.21833134619353 ], [ 5.079503025677416, 51.218789086283387 ], [ 5.080438992142096, 51.218135525244996 ], [ 5.079310900631511, 51.217555407500946 ], [ 5.07838044255931, 51.21833134619353 ] ] ] } } -] + "type": "FeatureCollection", + "crs": { + "type": "name", + "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"} + }, + "features": [ + { + "type": "Feature", + "properties": {"id": 23, "name": "Mol", "class": 4}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [5.099185309788365, 51.19128726234392], + [5.11418113136547, 51.196949475430756], + [5.126371845690255, 51.189132203507086], + [5.117041764554222, 51.18148814609719], + [5.097377985552487, 51.18444688342211], + [5.099185309788365, 51.19128726234392] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"id": 58, "name": "TAP", "class": 5}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [5.07838044255931, 51.21833134619353], + [5.079503025677416, 51.21878908628339], + [5.080438992142096, 51.218135525244996], + [5.079310900631511, 51.217555407500946], + [5.07838044255931, 51.21833134619353] + ] + ] + } + } + ] } diff --git a/tests/data/geojson/test_geojson_crs_from_epsg.geojson b/tests/data/geojson/test_geojson_crs_from_epsg.geojson index af9f18b7..e83ef59c 100644 --- a/tests/data/geojson/test_geojson_crs_from_epsg.geojson +++ b/tests/data/geojson/test_geojson_crs_from_epsg.geojson @@ -1,10 +1,39 @@ { -"type": "FeatureCollection", -"name": "Fields_testing", -"crs": { "type": "name", "properties": { "name": "EPSG:4326" } }, -"features": [ -{ "type": "Feature", "properties": { "id": "LT - Bo", "2016": 0, "2018": 1, "2020": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 4.829697291485939, 50.862054355087274 ], [ 4.831810433973708, 50.862769340731347 ], [ 4.832504715080205, 50.862051860576408 ], [ 4.830474041336835, 50.861345984658136 ], [ 4.829697291485939, 50.862054355087274 ] ] ] } }, -{ "type": "Feature", "properties": { "id": "GFT", "2016": 1, "2018": 1, "2020": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 4.798718572026502, 50.828548571482415 ], [ 4.800991986712735, 50.827265262059683 ], [ 4.796242473228493, 50.823638376357145 ], [ 4.794060093259593, 50.824541266457985 ], [ 4.798718572026502, 50.828548571482415 ] ] ] } } -] + "type": "FeatureCollection", + "name": "Fields_testing", + "crs": {"type": "name", "properties": {"name": "EPSG:4326"}}, + "features": [ + { + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "LT - Bo"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [4.829697291485939, 50.862054355087274], + [4.831810433973708, 50.86276934073135], + [4.832504715080205, 50.86205186057641], + [4.830474041336835, 50.861345984658136], + [4.829697291485939, 50.862054355087274] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"2016": 1, "2018": 1, "2020": 1, "id": "GFT"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [4.798718572026502, 50.828548571482415], + [4.800991986712735, 50.82726526205968], + [4.796242473228493, 50.823638376357145], + [4.794060093259593, 50.824541266457985], + [4.798718572026502, 50.828548571482415] + ] + ] + } + } + ] } - diff --git a/tests/data/geojson/test_geojson_crs_from_ogc_urn.geojson b/tests/data/geojson/test_geojson_crs_from_ogc_urn.geojson index 5f032071..cf733e83 100644 --- a/tests/data/geojson/test_geojson_crs_from_ogc_urn.geojson +++ b/tests/data/geojson/test_geojson_crs_from_ogc_urn.geojson @@ -1,10 +1,42 @@ { -"type": "FeatureCollection", -"name": "Fields_testing", -"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, -"features": [ -{ "type": "Feature", "properties": { "id": "LT - Bo", "2016": 0, "2018": 1, "2020": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 4.829697291485939, 50.862054355087274 ], [ 4.831810433973708, 50.862769340731347 ], [ 4.832504715080205, 50.862051860576408 ], [ 4.830474041336835, 50.861345984658136 ], [ 4.829697291485939, 50.862054355087274 ] ] ] } }, -{ "type": "Feature", "properties": { "id": "GFT", "2016": 1, "2018": 1, "2020": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 4.798718572026502, 50.828548571482415 ], [ 4.800991986712735, 50.827265262059683 ], [ 4.796242473228493, 50.823638376357145 ], [ 4.794060093259593, 50.824541266457985 ], [ 4.798718572026502, 50.828548571482415 ] ] ] } } -] + "type": "FeatureCollection", + "name": "Fields_testing", + "crs": { + "type": "name", + "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"} + }, + "features": [ + { + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "LT - Bo"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [4.829697291485939, 50.862054355087274], + [4.831810433973708, 50.86276934073135], + [4.832504715080205, 50.86205186057641], + [4.830474041336835, 50.861345984658136], + [4.829697291485939, 50.862054355087274] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"2016": 1, "2018": 1, "2020": 1, "id": "GFT"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [4.798718572026502, 50.828548571482415], + [4.800991986712735, 50.82726526205968], + [4.796242473228493, 50.823638376357145], + [4.794060093259593, 50.824541266457985], + [4.798718572026502, 50.828548571482415] + ] + ] + } + } + ] } - diff --git a/tests/data/geojson/test_geojson_crs_unspecified.geojson b/tests/data/geojson/test_geojson_crs_unspecified.geojson index 6fc6fb1b..1f6b7075 100644 --- a/tests/data/geojson/test_geojson_crs_unspecified.geojson +++ b/tests/data/geojson/test_geojson_crs_unspecified.geojson @@ -1,9 +1,38 @@ { -"type": "FeatureCollection", -"name": "Fields_testing", -"features": [ -{ "type": "Feature", "properties": { "id": "LT - Bo", "2016": 0, "2018": 1, "2020": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 4.829697291485939, 50.862054355087274 ], [ 4.831810433973708, 50.862769340731347 ], [ 4.832504715080205, 50.862051860576408 ], [ 4.830474041336835, 50.861345984658136 ], [ 4.829697291485939, 50.862054355087274 ] ] ] } }, -{ "type": "Feature", "properties": { "id": "GFT", "2016": 1, "2018": 1, "2020": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 4.798718572026502, 50.828548571482415 ], [ 4.800991986712735, 50.827265262059683 ], [ 4.796242473228493, 50.823638376357145 ], [ 4.794060093259593, 50.824541266457985 ], [ 4.798718572026502, 50.828548571482415 ] ] ] } } -] + "type": "FeatureCollection", + "name": "Fields_testing", + "features": [ + { + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "LT - Bo"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [4.829697291485939, 50.862054355087274], + [4.831810433973708, 50.86276934073135], + [4.832504715080205, 50.86205186057641], + [4.830474041336835, 50.861345984658136], + [4.829697291485939, 50.862054355087274] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"2016": 1, "2018": 1, "2020": 1, "id": "GFT"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [4.798718572026502, 50.828548571482415], + [4.800991986712735, 50.82726526205968], + [4.796242473228493, 50.823638376357145], + [4.794060093259593, 50.824541266457985], + [4.798718572026502, 50.828548571482415] + ] + ] + } + } + ] } - diff --git a/tests/data/geojson/test_geojson_invalid_coordinates.geojson b/tests/data/geojson/test_geojson_invalid_coordinates.geojson index ab42c886..a857b5fe 100644 --- a/tests/data/geojson/test_geojson_invalid_coordinates.geojson +++ b/tests/data/geojson/test_geojson_invalid_coordinates.geojson @@ -1,8 +1,38 @@ { -"type": "FeatureCollection", -"name": "Fields_testing", -"features": [ -{ "type": "Feature", "properties": { "id": "LT - Bo", "2016": 0, "2018": 1, "2020": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 4.829697291485939, 50.862054355087274 ], [ 4.831810433973708, 50.862769340731347 ], [ 4.832504715080205, 50.862051860576408 ], [ -361.0, 50.861345984658136 ], [ 4.829697291485939, 50.862054355087274 ] ] ] } }, -{ "type": "Feature", "properties": { "id": "GFT", "2016": 1, "2018": 1, "2020": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 4.798718572026502, 50.828548571482415 ], [ 4.800991986712735, 50.827265262059683 ], [ 4.796242473228493, 50.823638376357145 ], [ 4.794060093259593, 50.824541266457985 ], [ 4.798718572026502, 50.828548571482415 ] ] ] } } -] + "type": "FeatureCollection", + "name": "Fields_testing", + "features": [ + { + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "LT - Bo"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [4.829697291485939, 50.862054355087274], + [4.831810433973708, 50.86276934073135], + [4.832504715080205, 50.86205186057641], + [-361.0, 50.861345984658136], + [4.829697291485939, 50.862054355087274] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"2016": 1, "2018": 1, "2020": 1, "id": "GFT"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [4.798718572026502, 50.828548571482415], + [4.800991986712735, 50.82726526205968], + [4.796242473228493, 50.823638376357145], + [4.794060093259593, 50.824541266457985], + [4.798718572026502, 50.828548571482415] + ] + ] + } + } + ] } diff --git a/tests/data/geojson/thaipolys_ad.geojson b/tests/data/geojson/thaipolys_ad.geojson index 55ea7375..5cbaae25 100644 --- a/tests/data/geojson/thaipolys_ad.geojson +++ b/tests/data/geojson/thaipolys_ad.geojson @@ -1,249 +1,106 @@ { - "type": "FeatureCollection", - "name": "thaipolys_ad", - "crs": + "type": "FeatureCollection", + "name": "thaipolys_ad", + "crs": { + "type": "name", + "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"} + }, + "features": [ { - "type": "name", - "properties": - { - "name": "urn:ogc:def:crs:OGC:1.3:CRS84" - } + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "LT - Bo"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [98.77100705369968, 9.252203719672897], + [98.77100761749868, 9.251332023435165], + [98.77013019392238, 9.25133146227084], + [98.77012962796312, 9.252203158454805], + [98.77100705369968, 9.252203719672897] + ] + ] + } }, - "features": - [ - { - "type": "Feature", - "properties": - { - "id": "LT - Bo", - "2016": 0, - "2018": 1, - "2020": 1 - }, - "geometry": - { - "type": "Polygon", - "coordinates": - [ - [ - [ - 98.77100705369968, - 9.252203719672897 - ], - [ - 98.77100761749868, - 9.251332023435165 - ], - [ - 98.77013019392238, - 9.25133146227084 - ], - [ - 98.77012962796312, - 9.252203158454805 - ], - [ - 98.77100705369968, - 9.252203719672897 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": - { - "id": "yuyu", - "2016": 0, - "2018": 1, - "2020": 1 - }, - "geometry": - { - "type": "Polygon", - "coordinates": - [ - [ - [ - 100.22103486159209, - 19.937099522973114 - ], - [ - 100.22102817050522, - 19.93622889139501 - ], - [ - 100.22010752144534, - 19.93623521641539 - ], - [ - 100.22011420749023, - 19.93710584829251 - ], - [ - 100.22103486159209, - 19.937099522973114 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": - { - "id": "holahola", - "2016": 0, - "2018": 1, - "2020": 1 - }, - "geometry": - { - "type": "Polygon", - "coordinates": - [ - [ - [ - 98.41320559285191, - 9.130152677609567 - ], - [ - 98.4132064396922, - 9.129634801204366 - ], - [ - 98.41268534212357, - 9.12963395925008 - ], - [ - 98.41268449453133, - 9.130151835606735 - ], - [ - 98.41320559285191, - 9.130152677609567 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": - { - "id": "muu", - "2016": 0, - "2018": 1, - "2020": 1 - }, - "geometry": - { - "type": "Polygon", - "coordinates": - [ - [ - [ - 99.15161525072554, - 17.196952989011802 - ], - [ - 99.15161462797101, - 17.196187888971142 - ], - [ - 99.1508186217712, - 17.196188485959663 - ], - [ - 99.15081924125616, - 17.196953586028492 - ], - [ - 99.15161525072554, - 17.196952989011802 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": - { - "id": "meh", - "2016": 0, - "2018": 1, - "2020": 1 - }, - "geometry": - { - "type": "Polygon", - "coordinates": - [ - [ - [ - 103.24970664797146, - 16.149399463016426 - ], - [ - 103.24969462056812, - 16.14883702799096 - ], - [ - 103.24911269980473, - 16.14884865163908 - ], - [ - 103.24912472557321, - 16.149411087090822 - ], - [ - 103.24970664797146, - 16.149399463016426 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": - { - "id": "yeet", - "2016": 0, - "2018": 1, - "2020": 1 - }, - "geometry": - { - "type": "Polygon", - "coordinates": - [ - [ - [ - 101.54544714825106, - 13.083921911120795 - ], - [ - 101.5454421135335, - 13.083431498178864 - ], - [ - 101.54494182969499, - 13.083436432975173 - ], - [ - 101.54494686342564, - 13.083926846108417 - ], - [ - 101.54544714825106, - 13.083921911120795 - ] - ] - ] - } - } - ] -} \ No newline at end of file + { + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "yuyu"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [100.22103486159209, 19.937099522973114], + [100.22102817050522, 19.93622889139501], + [100.22010752144534, 19.93623521641539], + [100.22011420749023, 19.93710584829251], + [100.22103486159209, 19.937099522973114] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "holahola"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [98.41320559285191, 9.130152677609567], + [98.4132064396922, 9.129634801204366], + [98.41268534212357, 9.12963395925008], + [98.41268449453133, 9.130151835606735], + [98.41320559285191, 9.130152677609567] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "muu"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [99.15161525072554, 17.196952989011802], + [99.15161462797101, 17.196187888971142], + [99.1508186217712, 17.196188485959663], + [99.15081924125616, 17.196953586028492], + [99.15161525072554, 17.196952989011802] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "meh"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [103.24970664797146, 16.149399463016426], + [103.24969462056812, 16.14883702799096], + [103.24911269980473, 16.14884865163908], + [103.24912472557321, 16.149411087090822], + [103.24970664797146, 16.149399463016426] + ] + ] + } + }, + { + "type": "Feature", + "properties": {"2016": 0, "2018": 1, "2020": 1, "id": "yeet"}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [101.54544714825106, 13.083921911120795], + [101.5454421135335, 13.083431498178864], + [101.54494182969499, 13.083436432975173], + [101.54494686342564, 13.083926846108417], + [101.54544714825106, 13.083921911120795] + ] + ] + } + } + ] +} diff --git a/tests/test_delayed_vector.py b/tests/test_delayed_vector.py index d374bfe2..b568d060 100644 --- a/tests/test_delayed_vector.py +++ b/tests/test_delayed_vector.py @@ -1,3 +1,5 @@ +import re + import pytest from openeo_driver.delayed_vector import DelayedVector @@ -40,11 +42,7 @@ def test_geojson_url_invalid(requests_mock): def test_geojson_invalid_coordinates(): - dv = DelayedVector( - str(get_path("geojson/test_geojson_invalid_coordinates.geojson")) - ) - with pytest.raises(OpenEOApiException) as e: + dv = DelayedVector(str(get_path("geojson/test_geojson_invalid_coordinates.geojson"))) + expected_error = "Failed to parse Geojson. Invalid coordinate: [-361.0, 50.861345984658136]" + with pytest.raises(OpenEOApiException, match=re.escape(expected_error)): _ = dv.bounds - assert e.value.message.startswith( - "Failed to parse Geojson. Invalid coordinate: [-361.0, 50.861345984658136]" - )