diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2522ee05c..205dda3eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -285,7 +285,8 @@ jobs: working-directory: lite run: | set -eux - mkdir -p content && cp ../examples/*.jGIS ../examples/*.qgz ../examples/*.geojson ../examples/*.tif ../examples/*.zip ../examples/*.ipynb ../examples/*.gif ./content + cp --recursive --dereference ../ui-tests/content ./content + find ./content -type d -name ".ipynb_checkpoints" -exec rm -rf {} + jupyter lite build --contents content --output-dir dist - name: Upload Lite artifacts diff --git a/docs/conf.py b/docs/conf.py index e20bb956d..e69c939a4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -35,13 +35,7 @@ language = "en" jupyterlite_contents = [ - "../examples/*.jGIS", - "../examples/*.geojson", - "../examples/*.zip", - "../examples/*.gif", - "../examples/*.geojson", - "../examples/*.tif", - "../examples/*.ipynb", + "../examples", ] jupyterlite_dir = "." jupyterlite_config = "jupyter_lite_config.json" diff --git a/examples/01-Create_a_new_JGIS_document.ipynb b/examples/01-Create_a_new_JGIS_document.ipynb new file mode 100644 index 000000000..498748fe4 --- /dev/null +++ b/examples/01-Create_a_new_JGIS_document.ipynb @@ -0,0 +1,105 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "8dbc9440", + "metadata": {}, + "source": [ + "## What is \"The Map\" in a Geographic Information System (GIS) context?\n", + "\n", + "In traditional geography, a **map** is a picture that shows the layout of some part of the world — things like roads, rivers, buildings, or population data, all drawn at a certain scale and intended to illustrate or enable something specific.\n", + "\n", + "But in **digital mapping** (or Geographic Information Systems, GIS), a map is much more than just a picture — it's made up of **data** that can be viewed, edited, analyzed, and combined with other data.\n", + "\n", + "In GIS software like **JupyterGIS**, a digital map is actually a **document** that holds:\n", + "\n", + "- **Layers** — These are pieces of data, like roads, rivers, or land use. Each layer represents one kind of thing or phenomenon, in the physical world.\n", + "- **Basemaps** — These are background images, like satellite imagery or street maps, that help give context to your data layers.\n", + "- **Tools** — Things that let you analyze or edit the layers on your map.\n", + "\n", + "---\n", + "\n", + "## Dana Tomlin's Cartographic Model (Simplified)\n", + "\n", + "In his foundational work [GIS & Cartographic Modeling](https://archive.org/details/geographicinform00toml), Dana Tomlin, one of the founders of modern GIS, described the **Cartographic Model** as a way to think of maps not just as images, but as **tools for thinking and analysis**.\n", + "\n", + "In his model:\n", + "> A map is not just a picture of the world, but a **set of layers of data** that can be combined using logic and rules.\n", + "\n", + "In other words, each layer on the map has meaning — and by combining layers in specific ways we can answer questions like:\n", + "- Where is the best place to build a school?\n", + "- Which areas are at risk of flooding?\n", + "- How has a city's land use changed over time?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "639b7342-688d-47c6-be9f-d4f7e60b74e7", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "from jupytergis import GISDocument\n", + "\n", + "# Create a new GIS document (a digital map)\n", + "doc = GISDocument(\"local.jGIS\")\n", + "\n", + "# Display the map document in the notebook\n", + "doc" + ] + }, + { + "cell_type": "markdown", + "id": "1c58c922", + "metadata": {}, + "source": [ + "### What does this code do?\n", + "\n", + "1. `from jupytergis import GISDocument`\n", + " This line tells Python to load the `GISDocument` module from the `jupytergis` library. Think of the `GISDocument` module as the part of the pre-written JupyterGIS code that creates your digital map container in the notebook.\n", + "\n", + "2. `doc = GISDocument(\"local.jGIS\")`\n", + " This defines a variable called `doc` to store the command that will import the file `local.jGIS` as the `GISDocument`.\n", + " This document is where you'll add your layers (roads, rivers, buildings, etc.) and tools.\n", + "\n", + "3. `doc`\n", + " When you type this in a notebook cell and run it, it runs the module `GISDocument` to create an interactive map in your notebook, using the `local.jGIS` file. You can then later add layers, change the basemap, and do spatial analysis. You *could* use the complete command `GISDocument(\"local.jGIS\")` to run the GISModule, but storing the command in a short variable (like, `doc`) allows you to easily reuse the command, with less text, in your code. \n", + "\n", + "---\n", + "\n", + "### Summary\n", + "\n", + "So far, you've created the **foundation** of your GIS project — a digital **Map Document** that can hold multiple layers and allow you to explore and analyze spatial data.\n", + "\n", + "This is like opening a new document in Word or Google Docs — but instead of writing an essay, you're going to build and explore a map!" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.18" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/examples/explore.ipynb b/examples/99-Explore_data_in_a_map.ipynb similarity index 64% rename from examples/explore.ipynb rename to examples/99-Explore_data_in_a_map.ipynb index cc1398245..f19cd8ee9 100644 --- a/examples/explore.ipynb +++ b/examples/99-Explore_data_in_a_map.ipynb @@ -3,24 +3,50 @@ { "cell_type": "markdown", "id": "c3f4096f-cbd3-43e8-a986-520681f03581", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "# ESPM 157 - Intro to Spatial Data\n", "\n", "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0d1dbcb0", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Install dependencies:\n", "\n", - "Install dependencies:\n", - "\n", - "```bash\n", - "micromamba install geopandas ibis-duckdb\n", - "```" + "#!conda install geopandas ibis-framework\n", + "!mamba install geopandas ibis-framework -y" ] }, { "cell_type": "code", "execution_count": null, "id": "b76ae1f0-334e-41c0-9533-407c879b4ad6", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "import ibis\n", @@ -32,7 +58,13 @@ "cell_type": "code", "execution_count": null, "id": "837aa4e0-5eeb-48c1-97ce-3f8706503911", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "redlines = con.read_geo(\n", @@ -44,7 +76,13 @@ "cell_type": "code", "execution_count": null, "id": "4d3319fa-b3b4-4931-b073-98b649e41b65", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "city = redlines.filter(redlines.city == \"New Haven\")" @@ -55,7 +93,12 @@ "execution_count": null, "id": "34f7f4d6-28d6-4716-8e03-ac32c6ae3bb7", "metadata": { - "scrolled": true + "editable": true, + "scrolled": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] }, "outputs": [], "source": [ @@ -66,7 +109,13 @@ { "cell_type": "markdown", "id": "d37a610a-1444-43a3-900f-dfe16a890ab9", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "## OK, but what about spatial context?\n", "\n", @@ -77,7 +126,13 @@ "cell_type": "code", "execution_count": null, "id": "6e68aaac-dfc0-42d8-a3b9-05fce59524b2", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "from jupytergis import explore\n", @@ -103,7 +158,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.9" + "version": "3.10.18" } }, "nbformat": 4, diff --git a/examples/Notebook.ipynb b/examples/99-Open_an_existing_JGIS_Project_and_add_layers.ipynb similarity index 66% rename from examples/Notebook.ipynb rename to examples/99-Open_an_existing_JGIS_Project_and_add_layers.ipynb index 454864a56..495be590d 100644 --- a/examples/Notebook.ipynb +++ b/examples/99-Open_an_existing_JGIS_Project_and_add_layers.ipynb @@ -3,7 +3,13 @@ { "cell_type": "markdown", "id": "1008b547-f396-4960-8a80-118370f0fab1", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "# JupyterGIS Python API" ] @@ -11,16 +17,28 @@ { "cell_type": "markdown", "id": "28c64dd8-6b90-4408-bbeb-e5037add1fbc", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ - "#### Simple usage" + "#### Simple usage of JupyterGIS" ] }, { "cell_type": "code", "execution_count": null, "id": "050e5936-f9e1-44ff-8bc9-a8556d7643ee", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "from jupytergis import GISDocument" @@ -30,19 +48,16 @@ "cell_type": "code", "execution_count": null, "id": "9821d466-6ae7-418f-aea7-9d67153da7d6", - "metadata": {}, - "outputs": [], - "source": [ - "doc = GISDocument(\"france_hiking.jGIS\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f4a7000c-1bfc-4d41-8a0b-5c82c6e67716", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ + "doc = GISDocument(\"data/france_hiking.jGIS\")\n", "doc" ] }, @@ -50,7 +65,13 @@ "cell_type": "code", "execution_count": null, "id": "5938ba70-36d7-4af3-b877-815464ef6d1a", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "doc.add_raster_layer(\n", @@ -58,24 +79,37 @@ " name=\"Google Satellite\",\n", " attribution=\"Google\",\n", " opacity=0.6,\n", - ")" + ")\n", + "doc" ] }, { "cell_type": "code", "execution_count": null, "id": "69ac2a9a-d9a9-4170-b1f5-451b9fd5780e", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "doc.add_geojson_layer(path=\"france_regions.geojson\")" + "doc.add_geojson_layer(path=\"data/france_regions.geojson\")" ] }, { "cell_type": "code", "execution_count": null, "id": "3629be32-bf06-4f68-a734-9af3cc17a7e3", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "doc.add_image_layer(\n", @@ -92,7 +126,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "geoenv", "language": "python", "name": "python3" }, @@ -106,7 +140,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.4" + "version": "3.10.5" } }, "nbformat": 4, diff --git a/examples/vector_colors.ipynb b/examples/99-Vector_styling.ipynb similarity index 76% rename from examples/vector_colors.ipynb rename to examples/99-Vector_styling.ipynb index bb482e9ef..453856379 100644 --- a/examples/vector_colors.ipynb +++ b/examples/99-Vector_styling.ipynb @@ -14,10 +14,12 @@ "doc.add_raster_layer(url=\"https://tile.openstreetmap.org/{z}/{x}/{y}.png\")\n", "\n", "doc.add_geojson_layer(\n", - " path=\"france_regions.geojson\", color_expr={\"fill-color\": \"#FF0000\"}\n", + " path=\"data/france_regions.geojson\", color_expr={\"fill-color\": \"#FF0000\"}\n", ")\n", "\n", - "doc.add_geojson_layer(path=\"eq.geojson\", color_expr={\"circle-fill-color\": \"#00FF00\"})\n", + "doc.add_geojson_layer(\n", + " path=\"data/eq.geojson\", color_expr={\"circle-fill-color\": \"#00FF00\"}\n", + ")\n", "\n", "\n", "doc" @@ -35,6 +37,14 @@ " color_expr={\"fill-color\": \"#00FF00\", \"circle-fill-color\": \"#FF0000\"},\n", ")" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4aa76ecc-5258-4d55-af11-aabc0f8e8a7f", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -53,7 +63,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3.10.18" } }, "nbformat": 4, diff --git a/examples/buildings.jGIS b/examples/buildings.jGIS index b7e493a07..b646d24cf 100644 --- a/examples/buildings.jGIS +++ b/examples/buildings.jGIS @@ -18,6 +18,7 @@ "f99eb7b0-5e38-4078-b310-36a0746472aa": { "name": "OpenStreetMap.Mapnik Layer", "parameters": { + "opacity": 1.0, "source": "ed8628b0-3e0a-45d5-9cd0-65e2a7dd61f5" }, "type": "RasterLayer", @@ -28,10 +29,10 @@ "options": { "bearing": 0.0, "extent": [ - -10032886.560286574, - 4929317.720009053, - -9479479.712813895, - 5352849.232560834 + -10107593.611347267, + 4920123.006032353, + -9404772.661753202, + 5362043.946537534 ], "latitude": 41.86704023051257, "longitude": -87.64128426232207, @@ -55,6 +56,7 @@ "name": "OpenStreetMap.Mapnik", "parameters": { "attribution": "(C) OpenStreetMap contributors", + "interpolate": false, "maxZoom": 19.0, "minZoom": 0.0, "provider": "OpenStreetMap", diff --git a/examples/geotiff.jGIS b/examples/cloud_optimized_geotiff.jGIS similarity index 93% rename from examples/geotiff.jGIS rename to examples/cloud_optimized_geotiff.jGIS index 83da48da8..978694b3c 100644 --- a/examples/geotiff.jGIS +++ b/examples/cloud_optimized_geotiff.jGIS @@ -7,6 +7,7 @@ "6dd80360-2675-40cf-aaee-c7101ef1779a": { "name": "OpenStreetMap.Mapnik Layer", "parameters": { + "opacity": 1.0, "source": "a6a98ac4-0d1c-4a3d-af71-88a91f28ccb9" }, "type": "RasterLayer", @@ -156,16 +157,16 @@ "options": { "bearing": 0.0, "extent": [ - -16581744.230939213, - 7256550.623163676, - -14518220.507649817, - 9186521.41512343 + -17395896.73536663, + 7388742.110425381, + -13933942.049595186, + 9063108.873543771 ], - "latitude": 59.189857487558726, - "longitude": -139.6878683012635, + "latitude": 59.210048033386016, + "longitude": -140.72036514765887, "pitch": 0.0, "projection": "EPSG:3857", - "zoom": 5.901573011026124 + "zoom": 6.167855425018033 }, "schemaVersion": "0.5.0", "sources": { @@ -189,6 +190,7 @@ "name": "OpenStreetMap.Mapnik", "parameters": { "attribution": "(C) OpenStreetMap contributors", + "interpolate": false, "maxZoom": 19.0, "minZoom": 0.0, "provider": "OpenStreetMap", diff --git a/examples/eq.geojson b/examples/data/eq.geojson similarity index 100% rename from examples/eq.geojson rename to examples/data/eq.geojson diff --git a/examples/france_regions.geojson b/examples/data/france_regions.geojson similarity index 100% rename from examples/france_regions.geojson rename to examples/data/france_regions.geojson diff --git a/examples/geotiff-example.tif b/examples/data/geotiff-example.tif similarity index 100% rename from examples/geotiff-example.tif rename to examples/data/geotiff-example.tif diff --git a/examples/nyc.zip b/examples/data/nyc/nyc.zip similarity index 100% rename from examples/nyc.zip rename to examples/data/nyc/nyc.zip diff --git a/examples/data/nyc/nyc_roads.dbf b/examples/data/nyc/nyc_roads.dbf new file mode 100644 index 000000000..8bf100715 Binary files /dev/null and b/examples/data/nyc/nyc_roads.dbf differ diff --git a/examples/data/nyc/nyc_roads.prj b/examples/data/nyc/nyc_roads.prj new file mode 100644 index 000000000..74a29217d --- /dev/null +++ b/examples/data/nyc/nyc_roads.prj @@ -0,0 +1 @@ +PROJCS["NAD83(HARN) / New York Long Island (ftUS)", GEOGCS["NAD83(HARN)", DATUM["NAD83 (High Accuracy Regional Network)", SPHEROID["GRS 1980", 6378137.0, 298.257222101, AUTHORITY["EPSG","7019"]], TOWGS84[-0.991, 1.9072, 0.5129, 0.0257899075194932, -0.009650098960270402, -0.011659943232342112, 0.0], AUTHORITY["EPSG","6152"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH], AUTHORITY["EPSG","4152"]], PROJECTION["Lambert Conic Conformal (2SP)", AUTHORITY["EPSG","9802"]], PARAMETER["central_meridian", -74.0], PARAMETER["latitude_of_origin", 40.166666666666664], PARAMETER["standard_parallel_1", 41.03333333333333], PARAMETER["false_easting", 984250.0], PARAMETER["false_northing", 0.0], PARAMETER["standard_parallel_2", 40.666666666666664], UNIT["foot_survey_us", 0.30480060960121924], AXIS["Easting", EAST], AXIS["Northing", NORTH], AUTHORITY["EPSG","2908"]] diff --git a/examples/data/nyc/nyc_roads.shp b/examples/data/nyc/nyc_roads.shp new file mode 100644 index 000000000..82480fd1f Binary files /dev/null and b/examples/data/nyc/nyc_roads.shp differ diff --git a/examples/data/nyc/nyc_roads.shx b/examples/data/nyc/nyc_roads.shx new file mode 100644 index 000000000..a4bcb2d57 Binary files /dev/null and b/examples/data/nyc/nyc_roads.shx differ diff --git a/examples/radar.gif b/examples/data/radar.gif similarity index 100% rename from examples/radar.gif rename to examples/data/radar.gif diff --git a/examples/earthquakes.jGIS b/examples/earthquakes.jGIS index e8a0e55ef..e3f69c384 100644 --- a/examples/earthquakes.jGIS +++ b/examples/earthquakes.jGIS @@ -1,14 +1,10 @@ { "layerTree": [ "8de7c2c0-6024-4716-b542-031a89fb87f9", - "3e21d680-406f-4099-bd9e-3a4edb9a2c8b" + "8c99f4cd-849f-4d11-ae75-4100ea703f03" ], "layers": { - "3e21d680-406f-4099-bd9e-3a4edb9a2c8b": { - "filters": { - "appliedFilters": [], - "logicalOp": "all" - }, + "8c99f4cd-849f-4d11-ae75-4100ea703f03": { "name": "Earthquakes", "parameters": { "color": { @@ -21,74 +17,171 @@ "get", "mag" ], - 1.7444444444444445, + 1.2522222222222221, [ - 125.0, - 0.0, - 179.0, + 68.0, + 1.0, + 84.0, 1.0 ], - 2.5388888888888888, + 1.5544444444444445, [ - 116.0, - 0.0, - 218.0, + 71.0, + 44.0, + 122.0, 1.0 ], - 3.333333333333333, + 1.8566666666666667, [ - 98.0, - 74.0, - 237.0, + 59.0, + 81.0, + 139.0, 1.0 ], - 4.127777777777777, + 2.158888888888889, [ - 68.0, - 146.0, + 44.0, + 113.0, + 142.0, + 1.0 + ], + 2.4611111111111112, + [ + 33.0, + 144.0, + 141.0, + 1.0 + ], + 2.786666666666666, + [ + 39.0, + 173.0, + 129.0, + 1.0 + ], + 3.166666666666667, + [ + 92.0, + 200.0, + 99.0, + 1.0 + ], + 3.723333333333333, + [ + 170.0, + 220.0, + 50.0, + 1.0 + ], + 8.1, + [ + 253.0, 231.0, + 37.0, + 1.0 + ] + ], + "circle-radius": [ + "interpolate", + [ + "linear" + ], + [ + "get", + "mag" + ], + 1.2522222222222221, + 1.2522222222222221, + 1.5544444444444445, + 1.5544444444444445, + 1.8566666666666667, + 1.8566666666666667, + 2.158888888888889, + 2.158888888888889, + 2.4611111111111112, + 2.4611111111111112, + 2.786666666666666, + 2.786666666666666, + 3.166666666666667, + 3.166666666666667, + 3.723333333333333, + 3.723333333333333, + 8.1, + 8.1 + ], + "circle-stroke-color": [ + "interpolate", + [ + "linear" + ], + [ + "get", + "mag" + ], + 1.2522222222222221, + [ + 68.0, + 1.0, + 84.0, + 1.0 + ], + 1.5544444444444445, + [ + 71.0, + 44.0, + 122.0, + 1.0 + ], + 1.8566666666666667, + [ + 59.0, + 81.0, + 139.0, 1.0 ], - 4.922222222222222, + 2.158888888888889, [ - 0.0, - 204.0, - 197.0, + 44.0, + 113.0, + 142.0, 1.0 ], - 5.716666666666666, + 2.4611111111111112, [ - 0.0, - 247.0, - 146.0, + 33.0, + 144.0, + 141.0, 1.0 ], - 6.51111111111111, + 2.786666666666666, [ - 0.0, - 255.0, - 88.0, + 39.0, + 173.0, + 129.0, 1.0 ], - 7.3055555555555545, + 3.166666666666667, [ - 40.0, - 255.0, - 8.0, + 92.0, + 200.0, + 99.0, + 1.0 + ], + 3.723333333333333, + [ + 170.0, + 220.0, + 50.0, 1.0 ], 8.1, [ - 147.0, - 255.0, - 0.0, + 253.0, + 231.0, + 37.0, 1.0 ] ], - "circle-radius": 5.0, - "circle-stroke-color": "#62a0ea", - "circle-stroke-line-cap": "round", - "circle-stroke-line-join": "round", "circle-stroke-width": 1.25, "fill-color": [ "interpolate", @@ -99,84 +192,155 @@ "get", "mag" ], - 1.7444444444444445, + 1.2522222222222221, [ - 125.0, - 0.0, - 179.0, + 68.0, + 1.0, + 84.0, 1.0 ], - 2.5388888888888888, + 1.5544444444444445, [ - 116.0, - 0.0, - 218.0, + 71.0, + 44.0, + 122.0, 1.0 ], - 3.333333333333333, + 1.8566666666666667, [ - 98.0, - 74.0, - 237.0, + 59.0, + 81.0, + 139.0, 1.0 ], - 4.127777777777777, + 2.158888888888889, [ - 68.0, - 146.0, + 44.0, + 113.0, + 142.0, + 1.0 + ], + 2.4611111111111112, + [ + 33.0, + 144.0, + 141.0, + 1.0 + ], + 2.786666666666666, + [ + 39.0, + 173.0, + 129.0, + 1.0 + ], + 3.166666666666667, + [ + 92.0, + 200.0, + 99.0, + 1.0 + ], + 3.723333333333333, + [ + 170.0, + 220.0, + 50.0, + 1.0 + ], + 8.1, + [ + 253.0, 231.0, + 37.0, + 1.0 + ] + ], + "stroke-color": [ + "interpolate", + [ + "linear" + ], + [ + "get", + "mag" + ], + 1.2522222222222221, + [ + 68.0, + 1.0, + 84.0, 1.0 ], - 4.922222222222222, + 1.5544444444444445, [ - 0.0, - 204.0, - 197.0, + 71.0, + 44.0, + 122.0, 1.0 ], - 5.716666666666666, + 1.8566666666666667, [ - 0.0, - 247.0, - 146.0, + 59.0, + 81.0, + 139.0, 1.0 ], - 6.51111111111111, + 2.158888888888889, [ - 0.0, - 255.0, - 88.0, + 44.0, + 113.0, + 142.0, 1.0 ], - 7.3055555555555545, + 2.4611111111111112, [ - 40.0, - 255.0, - 8.0, + 33.0, + 144.0, + 141.0, + 1.0 + ], + 2.786666666666666, + [ + 39.0, + 173.0, + 129.0, + 1.0 + ], + 3.166666666666667, + [ + 92.0, + 200.0, + 99.0, + 1.0 + ], + 3.723333333333333, + [ + 170.0, + 220.0, + 50.0, 1.0 ], 8.1, [ - 147.0, - 255.0, - 0.0, + 253.0, + 231.0, + 37.0, 1.0 ] ], - "stroke-color": "#62a0ea", "stroke-width": 1.25 }, "opacity": 1.0, - "source": "348d85fa-3a71-447f-8a64-e283ec47cc7c", + "source": "578fb13e-9c82-4711-91f2-fb3671820583", "symbologyState": { - "colorRamp": "cool", - "method": "color", - "mode": "equal interval", + "colorRamp": "viridis", + "method": "radius", + "mode": "quantile", "nClasses": "9", "renderType": "Graduated", "value": "mag" - }, - "type": "circle" + } }, "type": "VectorLayer", "visible": true @@ -184,6 +348,7 @@ "8de7c2c0-6024-4716-b542-031a89fb87f9": { "name": "OpenStreetMap.Mapnik Layer", "parameters": { + "opacity": 1.0, "source": "b2ea427a-a51b-43ad-ae72-02cd900736d5" }, "type": "RasterLayer", @@ -194,23 +359,23 @@ "options": { "bearing": 0.0, "extent": [ - -19456309.48732131, - -3639686.263420881, - 2800931.776353102, - 12110454.564362008 + -22593476.882281035, + -1201358.2850676067, + -1464850.61351523, + 12083934.92889879 ], - "latitude": 35.52446437432016, - "longitude": -74.80890180273175, + "latitude": 43.84371392814177, + "longitude": -108.05981649913356, "pitch": 0.0, "projection": "EPSG:3857", - "zoom": 2.6670105136699993 + "zoom": 3.179712839741578 }, "schemaVersion": "0.5.0", "sources": { - "348d85fa-3a71-447f-8a64-e283ec47cc7c": { + "578fb13e-9c82-4711-91f2-fb3671820583": { "name": "Custom GeoJSON Layer Source", "parameters": { - "path": "eq.geojson" + "path": "data/eq.geojson" }, "type": "GeoJSONSource" }, @@ -218,6 +383,7 @@ "name": "OpenStreetMap.Mapnik", "parameters": { "attribution": "(C) OpenStreetMap contributors", + "interpolate": false, "maxZoom": 19.0, "minZoom": 0.0, "provider": "OpenStreetMap", diff --git a/examples/france_hiking.jGIS b/examples/france_hiking.jGIS index a50d64bf0..a65b6ee59 100644 --- a/examples/france_hiking.jGIS +++ b/examples/france_hiking.jGIS @@ -17,6 +17,7 @@ "4a0703b3-ed56-4158-8a2e-e008c3d0fee2": { "name": "OpenStreetMap.Mapnik Layer", "parameters": { + "opacity": 1.0, "source": "60da082e-8b70-4fa2-b2f0-48524468fea0" }, "type": "RasterLayer", @@ -36,16 +37,16 @@ "options": { "bearing": 0.0, "extent": [ - -2239574.063687247, - 3618804.2553047766, - 2597633.452669818, - 8142943.772506753 + -1758562.2264582724, + 4833787.226784039, + 3704101.498072755, + 7114345.535233745 ], - "latitude": 46.623742146769416, - "longitude": 1.6082511087277014, + "latitude": 47.195641286772855, + "longitude": 8.738538317730255, "pitch": 0.0, "projection": "EPSG:3857", - "zoom": 4.672508604627439 + "zoom": 5.722083946960902 }, "schemaVersion": "0.5.0", "sources": { @@ -53,6 +54,7 @@ "name": "NASAGIBS.ModisTerraTrueColorCR", "parameters": { "attribution": "Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.", + "interpolate": false, "maxZoom": 9.0, "minZoom": 1.0, "provider": "NASAGIBS", @@ -70,6 +72,7 @@ "name": "OpenStreetMap.Mapnik", "parameters": { "attribution": "(C) OpenStreetMap contributors", + "interpolate": false, "maxZoom": 19.0, "minZoom": 0.0, "provider": "OpenStreetMap", @@ -82,6 +85,7 @@ "name": "WaymarkedTrails.hiking", "parameters": { "attribution": "Map data: (C) OpenStreetMap contributors | Map style: (C) waymarkedtrails.org (CC-BY-SA)", + "interpolate": false, "maxZoom": 18.0, "minZoom": 0.0, "provider": "WaymarkedTrails", diff --git a/examples/geoparquet.jgis b/examples/geoparquet.jGIS similarity index 99% rename from examples/geoparquet.jgis rename to examples/geoparquet.jGIS index a634e73f8..be79c0e38 100644 --- a/examples/geoparquet.jgis +++ b/examples/geoparquet.jGIS @@ -60,4 +60,4 @@ "type": "GeoParquetSource" } } -} \ No newline at end of file +} diff --git a/examples/hillshade.jGIS b/examples/hillshade.jGIS index c05c2a28b..b39ef2471 100644 --- a/examples/hillshade.jGIS +++ b/examples/hillshade.jGIS @@ -7,6 +7,7 @@ "a82ef521-e727-4209-a5a0-145d66f18a06": { "name": "OpenStreetMap.Mapnik Layer", "parameters": { + "opacity": 1.0, "source": "ceef4036-b757-44bf-8a21-42c6c99dab72" }, "type": "RasterLayer", @@ -26,10 +27,10 @@ "options": { "bearing": 0.0, "extent": [ - 1258677.6374753749, - 5970540.9301103065, - 1287818.4633432643, - 5997795.7380603505 + 1243848.3593370197, + 5969949.2382145105, + 1302647.7414816194, + 5998387.429956145 ], "latitude": 47.25726805100891, "longitude": 11.437781841580746, @@ -43,6 +44,7 @@ "name": "OpenStreetMap.Mapnik", "parameters": { "attribution": "(C) OpenStreetMap contributors", + "interpolate": false, "maxZoom": 19.0, "minZoom": 0.0, "provider": "OpenStreetMap", diff --git a/examples/image.jGIS b/examples/image.jGIS index 0582c5951..7410fe44f 100644 --- a/examples/image.jGIS +++ b/examples/image.jGIS @@ -5,7 +5,7 @@ ], "layers": { "756cb737-f817-4ba6-b7c0-8da0b97b9778": { - "name": "Custom Image Layer Layer", + "name": "Radar", "parameters": { "opacity": 1.0, "source": "fb9729b8-82c6-48ac-a12b-6343c0e037ae" @@ -26,16 +26,16 @@ "options": { "bearing": 0.0, "extent": [ - -10835715.64562285, - -4131544.7694810475, - 718103.572681238, - 12390226.369708324 + -11380610.12432032, + 3752817.7844314026, + -6019296.164325077, + 6345805.479548599 ], - "latitude": 34.74543821495182, - "longitude": -45.44402781957822, + "latitude": 41.25016747852149, + "longitude": -78.15300880668768, "pitch": 0.0, "projection": "EPSG:3857", - "zoom": 3.0398860010821136 + "zoom": 5.5368556439314505 }, "schemaVersion": "0.5.0", "sources": { @@ -72,6 +72,7 @@ 37.936 ] ], + "interpolate": false, "path": "https://maplibre.org/maplibre-gl-js/docs/assets/radar.gif" }, "type": "ImageSource" diff --git a/examples/local.jGIS b/examples/local.jGIS index d7829e20b..d7cc4d8e0 100644 --- a/examples/local.jGIS +++ b/examples/local.jGIS @@ -1,37 +1,26 @@ { "layerTree": [ "f5e91204-3ce9-408e-b179-c6cf5f75f0f7", - "52e46caf-e212-4276-ade9-6b0683642f8d", - "042f37ac-6d05-4b07-a944-8f56fb889612" + "66198b90-5d1c-4637-a15d-450b17c4fcb6", + "aae4466d-49da-4308-b73d-046e974f92a4" ], "layers": { - "042f37ac-6d05-4b07-a944-8f56fb889612": { - "name": "Custom Shapefile Layer", + "66198b90-5d1c-4637-a15d-450b17c4fcb6": { + "name": "Radar", "parameters": { - "color": { - "fill-color": "#cc3342", - "stroke-color": "#cc3333", - "stroke-line-cap": "round", - "stroke-line-join": "round", - "stroke-width": 1.25 - }, "opacity": 1.0, - "source": "0e9d027f-56ea-427e-a845-a5ee33427e67", - "symbologyState": { - "renderType": "Single Symbol" - }, - "type": "line" + "source": "756b4c42-6ca0-40c1-9e3b-90c1f5f99fab" }, - "type": "VectorLayer", + "type": "ImageLayer", "visible": true }, - "52e46caf-e212-4276-ade9-6b0683642f8d": { - "name": "Custom Image Layer", + "aae4466d-49da-4308-b73d-046e974f92a4": { + "name": "Subset of Manhattan roads", "parameters": { "opacity": 1.0, - "source": "f124c6de-e444-4798-be88-61c3ee8968db" + "source": "d82b24cf-e43a-43aa-bc7b-2578adc7ef8a" }, - "type": "ImageLayer", + "type": "VectorLayer", "visible": true }, "f5e91204-3ce9-408e-b179-c6cf5f75f0f7": { @@ -60,16 +49,6 @@ }, "schemaVersion": "0.5.0", "sources": { - "0e9d027f-56ea-427e-a845-a5ee33427e67": { - "name": "Custom Shapefile Source", - "parameters": { - "attribution": "", - "encoding": "UTF-8", - "path": "nyc.zip", - "projection": "WGS84" - }, - "type": "ShapefileSource" - }, "3bd6b874-a28a-4ef6-bef8-a7257bb35c51": { "name": "OpenStreetMap.Mapnik", "parameters": { @@ -82,7 +61,7 @@ }, "type": "RasterSource" }, - "f124c6de-e444-4798-be88-61c3ee8968db": { + "756b4c42-6ca0-40c1-9e3b-90c1f5f99fab": { "name": "Custom Image Source", "parameters": { "coordinates": [ @@ -103,9 +82,20 @@ 37.936 ] ], - "path": "radar.gif" + "interpolate": false, + "path": "data/radar.gif" }, "type": "ImageSource" + }, + "d82b24cf-e43a-43aa-bc7b-2578adc7ef8a": { + "name": "Custom Shapefile Source", + "parameters": { + "attribution": "", + "encoding": "UTF-8", + "path": "data/nyc/nyc.zip", + "projection": "WGS84" + }, + "type": "ShapefileSource" } } } diff --git a/examples/pmtiles-raster.jGIS b/examples/pmtiles-raster.jGIS index 21fc3da80..1f49488f5 100644 --- a/examples/pmtiles-raster.jGIS +++ b/examples/pmtiles-raster.jGIS @@ -26,16 +26,16 @@ "options": { "bearing": 0.0, "extent": [ - -4738125.268435165, - -6775441.075785377, - 4738125.268435165, - 6775441.075785375 + -23812263.203224268, + -5492745.08424724, + 16262753.482354213, + 13889448.52028726 ], - "latitude": 0.0, - "longitude": 0.0, + "latitude": 35.25326049393334, + "longitude": -33.90919984933236, "pitch": 0.0, "projection": "EPSG:3857", - "zoom": 3.3258675805754185 + "zoom": 2.634811050171718 }, "schemaVersion": "0.5.0", "sources": { @@ -45,6 +45,7 @@ "attribution": "", "bounds": [], "htmlAttribution": "", + "interpolate": false, "maxZoom": 24.0, "minZoom": 0.0, "provider": "", diff --git a/examples/pmtiles-vector.jGIS b/examples/pmtiles-vector.jGIS index 16bde4f83..92bd14b75 100644 --- a/examples/pmtiles-vector.jGIS +++ b/examples/pmtiles-vector.jGIS @@ -28,10 +28,10 @@ "options": { "bearing": 0.0, "extent": [ - 19453193.898517665, - -4423184.339222121, - 19455683.36148536, - -4420855.9963195985 + 19451927.052515075, + -4423234.886693547, + 19456950.20748795, + -4420805.448848173 ], "latitude": -36.877317290655995, "longitude": 174.762195652956, diff --git a/examples/roads.jGIS b/examples/roads.jGIS index 4e6468261..a9475eef5 100644 --- a/examples/roads.jGIS +++ b/examples/roads.jGIS @@ -4,7 +4,7 @@ ], "layers": { "95bfd9ba-f561-414d-8e2b-bc401dae0d7f": { - "name": "Custom GeoJSON Layer", + "name": "Roads", "parameters": { "color": { "stroke-color": [ @@ -7470,16 +7470,16 @@ "options": { "bearing": 0.0, "extent": [ - -26469740.02358401, - -15110822.972668167, - -5335478.400520468, - 15110822.972668167 + -35940117.55484148, + -9691096.80226725, + 4134899.130737001, + 9691096.80226725 ], "latitude": 0.0, "longitude": -142.85556912566426, "pitch": 0.0, "projection": "EPSG:3857", - "zoom": 2.1686721181322306 + "zoom": 2.634811050171718 }, "schemaVersion": "0.5.0", "sources": { diff --git a/examples/shapefile.jGIS b/examples/shapefile.jGIS index 9c905f073..d77f850e0 100644 --- a/examples/shapefile.jGIS +++ b/examples/shapefile.jGIS @@ -1,7 +1,8 @@ { "layerTree": [ "54e0ea1f-32fd-4ff2-90fb-ad449a38f902", - "f909d9b9-bf07-42f6-8841-8d6470665dcb" + "f909d9b9-bf07-42f6-8841-8d6470665dcb", + "df947252-afb1-489f-8bce-7057318a50e3" ], "layers": { "54e0ea1f-32fd-4ff2-90fb-ad449a38f902": { @@ -12,8 +13,17 @@ "type": "RasterLayer", "visible": true }, + "df947252-afb1-489f-8bce-7057318a50e3": { + "name": "Subset of Manhattan roads", + "parameters": { + "opacity": 1.0, + "source": "c3215d81-4b47-4b93-ae1c-5eb0fe8a68a8" + }, + "type": "VectorLayer", + "visible": true + }, "f909d9b9-bf07-42f6-8841-8d6470665dcb": { - "name": "Custom Shapefile Layer", + "name": "Administrative boundaries", "parameters": { "color": { "fill-color": "#eaa4e7", @@ -62,6 +72,16 @@ }, "type": "RasterSource" }, + "c3215d81-4b47-4b93-ae1c-5eb0fe8a68a8": { + "name": "Custom Shapefile Source", + "parameters": { + "attribution": "", + "encoding": "UTF-8", + "path": "data/nyc/nyc.zip", + "projection": "WGS84" + }, + "type": "ShapefileSource" + }, "eb4b68da-eab6-44a1-8e75-ca9c871d2755": { "name": "Custom Shapefile Source", "parameters": { diff --git a/examples/test.jGIS b/examples/test.jGIS index d70bd73da..23400c9f9 100644 --- a/examples/test.jGIS +++ b/examples/test.jGIS @@ -18,6 +18,7 @@ "2467576f-b527-4cb7-998d-fa1d056fb8a1": { "name": "Open Street Map", "parameters": { + "opacity": 1.0, "source": "699facc9-e7c4-4f38-acf1-1fd7f02d9f36" }, "type": "RasterLayer", @@ -37,6 +38,7 @@ "a0044fd7-f167-445f-b3d1-620a8f94b498": { "name": "Open Topo Map", "parameters": { + "opacity": 1.0, "source": "5fd42e3b-4681-4607-b15d-65c3a3e89b32" }, "type": "RasterLayer", @@ -63,6 +65,7 @@ "5fd42e3b-4681-4607-b15d-65c3a3e89b32": { "name": "Open Topo Map", "parameters": { + "interpolate": false, "maxZoom": 24.0, "minZoom": 0.0, "url": "https://tile.opentopomap.org/{z}/{x}/{y}.png " @@ -72,6 +75,7 @@ "699facc9-e7c4-4f38-acf1-1fd7f02d9f36": { "name": "Open Street Map", "parameters": { + "interpolate": false, "maxZoom": 24.0, "minZoom": 0.0, "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png" @@ -81,7 +85,7 @@ "7d082e75-69d5-447a-82d8-b05cca5945ba": { "name": "france_regions", "parameters": { - "path": "france_regions.geojson", + "path": "data/france_regions.geojson", "valid": true }, "type": "GeoJSONSource" diff --git a/examples/world.jGIS b/examples/world.jGIS index 97deb6911..beba6b7a5 100644 --- a/examples/world.jGIS +++ b/examples/world.jGIS @@ -122,16 +122,16 @@ "options": { "bearing": 0.0, "extent": [ - -12349723.176694198, - -18128129.12502072, - 14293798.321822936, - 19971667.68010757 + -19065470.770224873, + -8769327.524723822, + 21009545.915353607, + 10612866.079810677 ], "latitude": 8.251719751227498, "longitude": 8.731962081730105, "pitch": 0.0, "projection": "EPSG:3857", - "zoom": 1.834471049984222 + "zoom": 2.634811050171718 }, "schemaVersion": "0.5.0", "sources": { diff --git a/ui-tests/content/data b/ui-tests/content/data new file mode 120000 index 000000000..5a83cd391 --- /dev/null +++ b/ui-tests/content/data @@ -0,0 +1 @@ +../../examples/data \ No newline at end of file diff --git a/examples/jgis.ipynb b/ui-tests/content/jgis.ipynb similarity index 100% rename from examples/jgis.ipynb rename to ui-tests/content/jgis.ipynb diff --git a/ui-tests/content/local.jGIS b/ui-tests/content/local.jGIS new file mode 120000 index 000000000..ee6fe253e --- /dev/null +++ b/ui-tests/content/local.jGIS @@ -0,0 +1 @@ +../../examples/local.jGIS \ No newline at end of file diff --git a/ui-tests/content/shapefile.jGIS b/ui-tests/content/shapefile.jGIS new file mode 120000 index 000000000..95d7ce24d --- /dev/null +++ b/ui-tests/content/shapefile.jGIS @@ -0,0 +1 @@ +../../examples/shapefile.jGIS \ No newline at end of file diff --git a/ui-tests/content/test.jGIS b/ui-tests/content/test.jGIS new file mode 120000 index 000000000..5c1c613a7 --- /dev/null +++ b/ui-tests/content/test.jGIS @@ -0,0 +1 @@ +../../examples/test.jGIS \ No newline at end of file diff --git a/ui-tests/tests/lite.spec.ts-snapshots/Render-notebook-chromium-linux.png b/ui-tests/tests/lite.spec.ts-snapshots/Render-notebook-chromium-linux.png index f544e4ed2..eb5d26a8b 100644 Binary files a/ui-tests/tests/lite.spec.ts-snapshots/Render-notebook-chromium-linux.png and b/ui-tests/tests/lite.spec.ts-snapshots/Render-notebook-chromium-linux.png differ diff --git a/ui-tests/tests/lite.spec.ts-snapshots/Render-shapefile-jGIS-chromium-linux.png b/ui-tests/tests/lite.spec.ts-snapshots/Render-shapefile-jGIS-chromium-linux.png index a5022416e..146f055d4 100644 Binary files a/ui-tests/tests/lite.spec.ts-snapshots/Render-shapefile-jGIS-chromium-linux.png and b/ui-tests/tests/lite.spec.ts-snapshots/Render-shapefile-jGIS-chromium-linux.png differ diff --git a/ui-tests/tests/lite.spec.ts-snapshots/Render-test-jGIS-chromium-linux.png b/ui-tests/tests/lite.spec.ts-snapshots/Render-test-jGIS-chromium-linux.png index 41f77ff25..202da9435 100644 Binary files a/ui-tests/tests/lite.spec.ts-snapshots/Render-test-jGIS-chromium-linux.png and b/ui-tests/tests/lite.spec.ts-snapshots/Render-test-jGIS-chromium-linux.png differ