Skip to content

Snapshots

Thorben Westerhuys edited this page Jan 8, 2021 · 2 revisions

A Snapshot

  • is a static JSON document for 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 Packages and Data Resources
  • Summary:
    • has
      • a collection of resources (aka the data) to be rendered as a map or other visual representations
      • and metadata
    • For rendering a map:
      • at least one (geo)spatial resource with styling information
      • referenced by a view object with a view.specType of gemeindescanSnapshot
      • view.resources should list the to be rendered resources by resource.name in order of display (first -> bottom, last -> top)
    • the view.spec should 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.name referenced by view.resources
        • is a GeoJSON object
        • is inlined with resource.data and not referenced as resource.path

Example Snapshot

{
  "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"
  }]
}

Clone this wiki locally