-
Notifications
You must be signed in to change notification settings - Fork 0
Snapshots
Thorben Westerhuys edited this page Jan 8, 2021
·
2 revisions
A Snapshot
- is a static JSON
documentfor describing (geo)spatial data - mainly to easily render maps, e.g. on the Spatial Data Package Platform
- Full Specification: Spatial Data Package Specification based on the Frictionless Data Specification of
Data PackagesandData Resources - Summary:
-
has- a collection of
resources(aka the data) to be rendered as amapor other visual representations - and metadata
- a collection of
- For rendering a map:
- at least one (geo)spatial
resourcewith styling information - referenced by a
viewobject with aview.specTypeofgemeindescanSnapshot -
view.resourcesshould list the to be rendered resources byresource.namein order of display (first -> bottom, last -> top)
- at least one (geo)spatial
- the
view.specshould contain-
view.spec.bounds: array of two geopoints (upper left and lower right corners of a rectangle) for rendering an initial viewpoint -
view.spec.legend: array defining the legend entries for the map -
view.spec.title: A title of the map -
view.spec.description: (optional) a more detailed description of the map - the
datapackage.resource.namereferenced byview.resources- is a GeoJSON object
- is inlined with
resource.dataand not referenced asresource.path
-
-
{
"name": "example-snapshot",
"description": "Minimal Example Snapshot",
"sources": [{
"title": "Example Source",
"url": "https://cividi.ch"
}],
"views": [{
"name": "mapview",
"resources": [
"geojson-resource-name-1",
"mapbox-resource-name"
],
"specType": "gemeindescanSnapshot",
"spec": {
"title": "Snapshot Title",
"description": "Snapshot Description",
"bounds": [
"geo:47.43668029143545,9.355459213256836",
"geo:47.483104811626674,9.424123764038086"
],
"legend": [{
"shape": "square",
"size": 0.5,
"color": "#fff",
"opacity": 0.2,
"label": "Legend text",
"primary": true
}]
}
}],
"resources": [{
"title": "Example GeoJSON resource",
"description": "Example GeoJSON resource",
"mediatype": "application/geo+json",
"name": "geojson-resource-name-1",
"data": {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[9.294214034, 47.396980325],
[9.291692794, 47.403333351],
[9.306849507, 47.414616277],
[9.367107729, 47.445654958],
[9.434770973, 47.43213103],
[9.361936383, 47.404015763],
[9.294214034, 47.396980325]
]
]
},
"properties": {
"fid": 231,
"fill": "#6a6a6a",
"title": "St. Gallen",
"stroke": "#fff",
"fill-opacity": 0.2,
"stroke-width": 5,
"stroke-opacity": 1
}
}]
}
}, {
"path": "mapbox://styles/gemeindescan/ck6qnoijj28od1is9u1wbb3vr",
"mediatype": "application/vnd.mapbox-vector-tile",
"name": "mapbox-resource-name"
}]
}