From c7809f98c97b02c130cf5075f588cc6e6ef43154 Mon Sep 17 00:00:00 2001 From: arjxn-py Date: Sun, 29 Sep 2024 18:43:51 +0530 Subject: [PATCH 1/4] Add `shapefileTest.jGIS` --- examples/shapefileTest.jGIS | 95 +++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 examples/shapefileTest.jGIS diff --git a/examples/shapefileTest.jGIS b/examples/shapefileTest.jGIS new file mode 100644 index 00000000..a8efa23e --- /dev/null +++ b/examples/shapefileTest.jGIS @@ -0,0 +1,95 @@ +{ + "layerTree": [ + "54e0ea1f-32fd-4ff2-90fb-ad449a38f902", + "9ccab8f8-a170-4977-92b1-ab5f42175c48", + "61ef4256-0d6b-4810-93a7-cf29b9e3ae00" + ], + "layers": { + "54e0ea1f-32fd-4ff2-90fb-ad449a38f902": { + "name": "OpenStreetMap.Mapnik Layer", + "parameters": { + "source": "780c4234-ba6d-4da2-9731-739f6c4d8033" + }, + "type": "RasterLayer", + "visible": true + }, + "61ef4256-0d6b-4810-93a7-cf29b9e3ae00": { + "filters": { + "appliedFilters": [], + "logicalOp": "all" + }, + "name": "Custom Shapefile Layer", + "parameters": { + "opacity": 1.0, + "source": "df86531e-086d-48fa-bfec-98477ec554a4", + "type": "line" + }, + "type": "VectorLayer", + "visible": true + }, + "9ccab8f8-a170-4977-92b1-ab5f42175c48": { + "name": "Custom Shapefile Layer", + "parameters": { + "opacity": 1.0, + "source": "284311a5-01a0-4333-a120-19c23a37e064", + "type": "line" + }, + "type": "VectorLayer", + "visible": true + } + }, + "options": { + "bearing": 0.0, + "extent": [ + -9999255.896951001, + 3675836.689228255, + -7012315.526044298, + 6666919.834574496 + ], + "latitude": 42.069382387280626, + "longitude": -76.40877308083776, + "pitch": 0.0, + "projection": "EPSG:3857", + "zoom": 5.2398182281592565 + }, + "sources": { + "284311a5-01a0-4333-a120-19c23a37e064": { + "name": "Custom Shapefile Source", + "parameters": { + "additionalFiles": {}, + "attribution": "", + "encoding": "UTF-8", + "path": "https://www2.census.gov/geo/tiger/GENZ2015/shp/cb_2015_us_county_500k.zip", + "projection": "WGS84" + }, + "type": "ShapefileSource" + }, + "780c4234-ba6d-4da2-9731-739f6c4d8033": { + "name": "OpenStreetMap.Mapnik", + "parameters": { + "attribution": "(C) OpenStreetMap contributors", + "maxZoom": 19.0, + "minZoom": 0.0, + "provider": "OpenStreetMap", + "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png", + "urlParameters": {} + }, + "type": "RasterSource" + }, + "df86531e-086d-48fa-bfec-98477ec554a4": { + "name": "Custom Shapefile Source", + "parameters": { + "additionalFiles": {}, + "attribution": "", + "encoding": "UTF-8", + "path": "https://docs.geoserver.org/stable/en/user/_downloads/30e405b790e068c43354367cb08e71bc/nyc_roads.zip", + "projection": "WGS84" + }, + "type": "ShapefileSource" + } + }, + "terrain": { + "exaggeration": 0.0, + "source": "" + } +} \ No newline at end of file From 99c364db3ad650b30266abdcd604e755466010c8 Mon Sep 17 00:00:00 2001 From: arjxn-py Date: Sun, 29 Sep 2024 18:56:31 +0530 Subject: [PATCH 2/4] Let's give distinct color to another layer --- examples/shapefileTest.jGIS | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/shapefileTest.jGIS b/examples/shapefileTest.jGIS index a8efa23e..82f23925 100644 --- a/examples/shapefileTest.jGIS +++ b/examples/shapefileTest.jGIS @@ -20,6 +20,13 @@ }, "name": "Custom Shapefile Layer", "parameters": { + "color": { + "fill-color": "#ff0000", + "stroke-color": "#ff0000", + "stroke-line-cap": "round", + "stroke-line-join": "round", + "stroke-width": 1.25 + }, "opacity": 1.0, "source": "df86531e-086d-48fa-bfec-98477ec554a4", "type": "line" @@ -41,16 +48,16 @@ "options": { "bearing": 0.0, "extent": [ - -9999255.896951001, - 3675836.689228255, - -7012315.526044298, - 6666919.834574496 + -8262247.857073612, + 4961071.288111334, + -8221407.547578438, + 5002025.042910661 ], - "latitude": 42.069382387280626, - "longitude": -76.40877308083776, + "latitude": 40.79089967838061, + "longitude": -74.03759794079146, "pitch": 0.0, "projection": "EPSG:3857", - "zoom": 5.2398182281592565 + "zoom": 11.430346702791901 }, "sources": { "284311a5-01a0-4333-a120-19c23a37e064": { From 90f1a486040f2f2c2914b5345c1ac11171e96be5 Mon Sep 17 00:00:00 2001 From: arjxn-py Date: Mon, 30 Sep 2024 14:15:01 +0530 Subject: [PATCH 3/4] Rename example file for shapefile --- examples/{shapefileTest.jGIS => shapefile.jGIS} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{shapefileTest.jGIS => shapefile.jGIS} (100%) diff --git a/examples/shapefileTest.jGIS b/examples/shapefile.jGIS similarity index 100% rename from examples/shapefileTest.jGIS rename to examples/shapefile.jGIS From 108619044128747f73548519ffb8e2066815fe16 Mon Sep 17 00:00:00 2001 From: arjxn-py Date: Mon, 30 Sep 2024 14:15:22 +0530 Subject: [PATCH 4/4] add shapefile-test in `ui-tests` --- ui-tests/tests/gis-files/shapefile-test.jGIS | 98 ++++++++++++++++++++ ui-tests/tests/ui.spec.ts | 2 +- 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 ui-tests/tests/gis-files/shapefile-test.jGIS diff --git a/ui-tests/tests/gis-files/shapefile-test.jGIS b/ui-tests/tests/gis-files/shapefile-test.jGIS new file mode 100644 index 00000000..018eef6c --- /dev/null +++ b/ui-tests/tests/gis-files/shapefile-test.jGIS @@ -0,0 +1,98 @@ +{ + "sources": { + "773e2245-d11b-42d5-a4ac-2f50293d11c7": { + "type": "RasterSource", + "name": "OpenStreetMap.Mapnik", + "parameters": { + "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png", + "minZoom": 0, + "maxZoom": 19, + "attribution": "(C) OpenStreetMap contributors", + "provider": "OpenStreetMap", + "urlParameters": {} + } + }, + "1c374c77-ab13-4583-a225-8a2f1d8d55b8": { + "type": "ShapefileSource", + "name": "Custom Shapefile Source", + "parameters": { + "attribution": "", + "projection": "WGS84", + "encoding": "UTF-8", + "additionalFiles": {}, + "path": "https://www2.census.gov/geo/tiger/GENZ2015/shp/cb_2015_us_county_500k.zip" + } + }, + "52aebf1f-713f-413c-a77e-b1cc096ddb86": { + "type": "ShapefileSource", + "name": "Custom Shapefile Source", + "parameters": { + "attribution": "", + "projection": "WGS84", + "encoding": "UTF-8", + "additionalFiles": {}, + "path": "https://docs.geoserver.org/stable/en/user/_downloads/30e405b790e068c43354367cb08e71bc/nyc_roads.zip" + } + } + }, + "layers": { + "56629dbf-c321-4953-9c54-cc9321af53ba": { + "type": "RasterLayer", + "parameters": { + "source": "773e2245-d11b-42d5-a4ac-2f50293d11c7" + }, + "visible": true, + "name": "OpenStreetMap.Mapnik Layer" + }, + "19c17b24-704f-4557-bc8e-4c98df293a7a": { + "type": "VectorLayer", + "parameters": { + "type": "line", + "opacity": 1, + "source": "1c374c77-ab13-4583-a225-8a2f1d8d55b8" + }, + "visible": true, + "name": "Custom Shapefile Layer" + }, + "f9dad6ae-eca9-4667-8538-d628c91cfdd3": { + "type": "VectorLayer", + "parameters": { + "type": "line", + "opacity": 1, + "source": "52aebf1f-713f-413c-a77e-b1cc096ddb86", + "color": { + "fill-color": "#ff0000", + "stroke-color": "#ff0000", + "stroke-width": 1.25, + "stroke-line-join": "round", + "stroke-line-cap": "round" + } + }, + "visible": true, + "name": "Custom Shapefile Layer" + } + }, + "layerTree": [ + "56629dbf-c321-4953-9c54-cc9321af53ba", + "19c17b24-704f-4557-bc8e-4c98df293a7a", + "f9dad6ae-eca9-4667-8538-d628c91cfdd3" + ], + "options": { + "latitude": 45.89950745475744, + "longitude": -81.95989943738823, + "zoom": 2.527260252685426, + "bearing": 0, + "pitch": 0, + "projection": "EPSG:3857", + "extent": [ + -18872442.044319667, + -4038758.305284189, + 624973.5026437324, + 15567277.941105189 + ] + }, + "terrain": { + "source": "", + "exaggeration": 0 + } +} \ No newline at end of file diff --git a/ui-tests/tests/ui.spec.ts b/ui-tests/tests/ui.spec.ts index 534d5d04..2953e825 100644 --- a/ui-tests/tests/ui.spec.ts +++ b/ui-tests/tests/ui.spec.ts @@ -4,7 +4,7 @@ import path from 'path'; test.use({ autoGoto: false }); test.describe('UI Test', () => { - const fileList = ['test.jGIS', 'buildings.qgz']; + const fileList = ['test.jGIS', 'buildings.qgz', 'shapefile-test.jGIS']; test.describe('File operations', () => { test.beforeAll(async ({ request }) => {