Skip to content

Commit

Permalink
Add test for ShapeFiles (#164)
Browse files Browse the repository at this point in the history
* Add `shapefileTest.jGIS`

* Let's give distinct color to another layer

* Rename example file for shapefile

* add shapefile-test in `ui-tests`
  • Loading branch information
arjxn-py authored Oct 1, 2024
1 parent 6729974 commit 459b18a
Show file tree
Hide file tree
Showing 3 changed files with 201 additions and 1 deletion.
102 changes: 102 additions & 0 deletions examples/shapefile.jGIS
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"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": {
"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"
},
"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": [
-8262247.857073612,
4961071.288111334,
-8221407.547578438,
5002025.042910661
],
"latitude": 40.79089967838061,
"longitude": -74.03759794079146,
"pitch": 0.0,
"projection": "EPSG:3857",
"zoom": 11.430346702791901
},
"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": ""
}
}
98 changes: 98 additions & 0 deletions ui-tests/tests/gis-files/shapefile-test.jGIS
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion ui-tests/tests/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit 459b18a

Please sign in to comment.