Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified workshop/content/docs/assets/images/leaflet-hyderabad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified workshop/content/docs/assets/images/leaflet-hyderabad2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified workshop/content/docs/assets/images/vtiles-attributes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
245 changes: 117 additions & 128 deletions workshop/content/docs/publishing/ogcapi-tiles.md

Large diffs are not rendered by default.

45 changes: 19 additions & 26 deletions workshop/exercises/html/vector-tiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,33 @@
<head><title>OGC API - Tiles exercise</title></head>
<body>
<div id="map" style="width:100vw;height:100vh;"></div>

<!-- load leaflet -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin="" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>

<!-- load VectorGrid extension -->
<script src="https://unpkg.com/[email protected]/dist/Leaflet.VectorGrid.bundled.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" />

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/Leaflet.VectorGrid.bundled.js"></script>
<script>
map = L.map('map').setView({ lat: 58.37, lng: 26.72 }, 7);
map = L.map('map').setView({ lat: 17.425181, lng: 78.5493906 }, 11);
map.addLayer(
new L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; Esri &mdash; National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC',
minZoom: 1,
maxZoom: 16,
}));
function getColor(val){
if (val < 0) {return "#ffffff"}
else if (val < 400) {return "#ffbfbf"}
else if (val < 1500) {return "#ff8080"}
else if (val < 3000) {return "#ff4040"}
else return "#ff0000";
if (val < 40) {return "#f2e6c7"}
else if (val < 80) {return "#8fa37e"}
else if (val < 100) {return "#f0d17d"}
else if (val < 120) {return "#d7ded1"}
else return "#c2d0d9";
}
var vectorTileStyling = {
bathingwaterestonia: function(properties) {
console.log(properties)
greater_hyderabad_municipal_corporation_ward_Boundaries: function(properties) {
return ({
fill: true,
fillColor: getColor(properties.visitors),
fillColor: getColor(properties.objectid),
color: "#ffffff",
fillOpacity: 1.0,
weight: 1,
weight: 5,
//color: "#ffffff",
opacity: 1.0,
});
}
Expand All @@ -48,8 +38,11 @@
interactive: true,
vectorTileLayerStyles: vectorTileStyling,
};
var pbfURL='http://localhost:5000/collections/bathingwater-estonia/tiles/WebMercatorQuad/{z}/{x}/{y}?f=mvt';
var pbfLayer=L.vectorGrid.protobuf(pbfURL,mapVectorTileOptions).addTo(map);
var pbfURL='http://localhost:5000/collections/hyderabad/tiles/WorldCRS84Quad/{z}/{x}/{y}?f=mvt';
var pbfLayer=L.vectorGrid.protobuf(pbfURL,mapVectorTileOptions).on('click',function(e) {
console.log(e.layer);
L.DomEvent.stop(e);
}).addTo(map);
</script>
</body>
</html>
</html>
25 changes: 10 additions & 15 deletions workshop/exercises/pygeoapi.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,36 +282,31 @@ resources:
## END - EXERCISE 3 - Coverages

## START - EXERCISE 4 - Tiles
# bathingwater-estonia:
# hyderabad:
# type: collection
# title: Bathing water sources
# description: Data of bathing water sources used by water supply systems under the supervision of the Health Board from the Water Health Information System.
# title: Greater Hyderabad Municipal Corporation ward boundaries
# description: The city ward boundaries represent the administrative and electoral boundary areas of the city. It plays a great role in planning of the city, for each council of the municipal corporation.
# keywords:
# - Water
# - Water bodies
# - Drilled wells
# - Surface water
# - Groundwater
# - Environmental health
# - Health
# - Bathing water
# - Boundaries
# - Administrative
# - Ward
# links:
# - type: text/html
# rel: canonical
# title: information
# href: https://avaandmed.eesti.ee/api/datasets/slug/supluskohad
# href: https://livingatlas-dcdev.opendata.arcgis.com/datasets/a090c89d52f1498f96a82e97b8bfb83e_0/
# hreflang: en-US
# extents:
# spatial:
# bbox: [22.2290936066586440,57.6912449743385451,28.2024877654160555,59.6097269178904412]
# bbox: [78.2379194985166180,17.2908061510471995,78.6217049083810764,17.5618443356918768]
# crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
# temporal:
# begin: null
# end: null # or empty
# providers:
# - type: feature
# name: GeoJSON
# data: /data/tartu/bathingwater-estonia.geojson
# data: /data/hyderabad/greater_hyderabad_municipal_corporation_ward_Boundaries.geojson
# id_field: id
# - type: tile
# name: MVT-tippecanoe
Expand Down Expand Up @@ -539,4 +534,4 @@ resources:
# name: SensorThings
# data: https://toronto-bike-snapshot.sensorup.com/v1.0/
# entity: Things
## END - EXERCISE 9 - SensorThings Proxy
## END - EXERCISE 9 - SensorThings Proxy
Loading