ohsome Data Structure#

Snapshots#

The term “snapshot” usually refers to the OSM data at a specific point in time. When downloading OSM data from almost any website, you will download a specific snapshot. A snapshot usually contains only information on the latest version of each object in OSM. E.g. if a building has been created and then someone else will change the outline of this building, only the uid of the second contributor will be visible in the snapshot.

{
  "attribution" : {
    "url" : "https://ohsome.org/copyrights",
    "text" : "© OpenStreetMap contributors"
  },
  "apiVersion" : "1.7.0",
  "type" : "FeatureCollection",
  "features" : [{
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        8.7037542,
        49.4101107
      ]
    },
    "properties" : {
      "@changesetId" : 52501623,
      "@lastEdit" : "2017-09-30T07:41:13Z",
      "@osmId" : "node/5139030666",
      "@osmType" : "node",
      "@snapshotTimestamp" : "2019-09-01T00:00:00Z",
      "@version" : 1,
      "amenity" : "bicycle_rental",
      "capacity" : "8",
      "name" : "Heidelberg Altstadt - Theaterstraße",
      "ref" : "2573"
    }
  }]
}

Full History#

OSM objects can change over time. The full history view allows you to inspect each individual version of an OSM feature.

{
  "attribution" : {
    "url" : "https://ohsome.org/copyrights",
    "text" : "© OpenStreetMap contributors"
  },
  "apiVersion" : "1.7.0",
  "type" : "FeatureCollection",
  "features" : [{
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        8.6755805,
        49.4185788
      ]
    },
    "properties" : {
      "@changesetId" : 44203784,
      "@osmId" : "node/4540889804",
      "@osmType" : "node",
      "@validFrom" : "2016-12-06T09:14:51Z",
      "@validTo" : "2017-04-06T22:04:42Z",
      "@version" : 1,
      "addr:city" : "Heidelberg",
      "addr:housename" : "Mathematikon",
      "addr:housenumber" : "45",
      "addr:postcode" : "69120",
      "addr:street" : "Berliner Straße",
      "level" : "4",
      "name" : "Heidelberg Institute for Geoinformation Technology",
      "office" : "research",
      "short_name" : "HeiGIT",
      "website" : "http://www.geog.uni-heidelberg.de/gis/heigit.html"
    }
  }, {
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        8.6755805,
        49.4185788
      ]
    },
    "properties" : {
      "@changesetId" : 47522379,
      "@osmId" : "node/4540889804",
      "@osmType" : "node",
      "@validFrom" : "2017-04-06T22:04:42Z",
      "@validTo" : "2017-10-14T19:16:15Z",
      "@version" : 2,
      "addr:city" : "Heidelberg",
      "addr:housenumber" : "45",
      "addr:postcode" : "69120",
      "addr:street" : "Berliner Straße",
      "level" : "4",
      "name" : "Heidelberg Institute for Geoinformation Technology",
      "office" : "research",
      "short_name" : "HeiGIT",
      "website" : "http://www.geog.uni-heidelberg.de/gis/heigit.html"
    }
  }, {
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        8.6755805,
        49.4185788
      ]
    },
    "properties" : {
      "@changesetId" : 52935400,
      "@osmId" : "node/4540889804",
      "@osmType" : "node",
      "@validFrom" : "2017-10-14T19:16:15Z",
      "@validTo" : "2018-06-30T23:19:42Z",
      "@version" : 3,
      "addr:city" : "Heidelberg",
      "addr:housenumber" : "45",
      "addr:postcode" : "69120",
      "addr:street" : "Berliner Straße",
      "level" : "4",
      "name" : "Heidelberg Institute for Geoinformation Technology",
      "office" : "research",
      "short_name" : "HeiGIT",
      "website" : "http://www.geog.uni-heidelberg.de/gis/heigit.html",
      "wheelchair" : "yes"
    }
  }, {
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        8.6755805,
        49.4185788
      ]
    },
    "properties" : {
      "@changesetId" : 60311872,
      "@osmId" : "node/4540889804",
      "@osmType" : "node",
      "@validFrom" : "2018-06-30T23:19:42Z",
      "@validTo" : "2019-09-04T10:14:06Z",
      "@version" : 4,
      "addr:city" : "Heidelberg",
      "addr:housenumber" : "45",
      "addr:postcode" : "69120",
      "addr:street" : "Berliner Straße",
      "level" : "4",
      "name" : "Heidelberg Institute for Geoinformation Technology",
      "office" : "research",
      "short_name" : "HeiGIT",
      "website" : "https://www.geog.uni-heidelberg.de/gis/heigit_en.html",
      "wheelchair" : "yes"
    }
  }, {
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        8.6756824,
        49.4184793
      ]
    },
    "properties" : {
      "@changesetId" : 74076406,
      "@osmId" : "node/4540889804",
      "@osmType" : "node",
      "@validFrom" : "2019-09-04T10:14:06Z",
      "@validTo" : "2019-09-14T13:54:37Z",
      "@version" : 5,
      "addr:city" : "Heidelberg",
      "addr:housenumber" : "45",
      "addr:postcode" : "69120",
      "addr:street" : "Berliner Straße",
      "level" : "4",
      "name" : "Heidelberg Institute for Geoinformation Technology",
      "office" : "research",
      "short_name" : "HeiGIT",
      "website" : "https://www.geog.uni-heidelberg.de/gis/heigit_en.html",
      "wheelchair" : "yes"
    }
  }, {
    "type" : "Feature",
    "geometry" : {
      "type" : "Point",
      "coordinates" : [
        8.6756824,
        49.4184793
      ]
    },
    "properties" : {
      "@changesetId" : 74474248,
      "@osmId" : "node/4540889804",
      "@osmType" : "node",
      "@validFrom" : "2019-09-14T13:54:37Z",
      "@validTo" : "2022-01-01T00:00:00Z",
      "@version" : 6,
      "addr:city" : "Heidelberg",
      "addr:housenumber" : "45",
      "addr:postcode" : "69120",
      "addr:street" : "Berliner Straße",
      "level" : "4",
      "name" : "Heidelberg Institute for Geoinformation Technology",
      "office" : "research",
      "short_name" : "HeiGIT",
      "website" : "https://heigit.org",
      "wheelchair" : "yes"
    }
  }]
}

For individual OSM features you can also inspect the OSM history using OSM Deep History. You can also check the history through the ohsome API elementsFullHistory extraction endpoint like this: https://api.ohsome.org/v1/elementsFullHistory/geometry?bboxes=8.5,49.0,9.0,49.5&properties=tags,metadata&filter=id:node/4540889804&time=2008-01-01%2C2022-10-01

Quick-Exercise

Go to https://www.openstreetmap.org and search for a place you have recently visited. Use the query tool and find the OSM ID for a random feature. Ideally this OSM object should have been changed in the past. Then, use this OSM id and check for its history on https://osmlab.github.io/osm-deep-history.

Contributions#

In contrast to snapshots, contributions put an emphasis more on the history of the OSM data. A contribution often refers to an edit performed by an OSM contributor for a specific OSM object. For instance, creating a new building can be seen as a contribution. There are different types of contributions. In general one of the following:

  • creation

  • tag change

  • geometry change

  • deletion

Creation#

Whenever a users creates a new object in OSM (e.g. draws a polygon, sets the key-value pair to building=yes and uploads to OSM) this will be referred to as an object added to OSM.

{
  "type": "Feature",
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [
        8.6857354,
        49.3958786
      ],
      [
        8.6857629,
        49.3954209
      ],
      [
        8.6863182,
        49.395676
      ],
      [
        8.6867497,
        49.3958774
      ],
      [
        8.6875164,
        49.3964447
      ]
    ]
  },
  "properties": {
    "@changesetId": 36451344,
    "@contributionChangesetId": 36451344,
    "@creation": true,
    "@osmId": "way/390276574",
    "@osmType": "way",
    "@timestamp": "2016-01-08T19:07:07Z",
    "@version": 1,
    "natural": "tree_row"
  }
}

Tag Change#

Users can modify existing objects in OSM. If the tag of an object is adjusted (e.g. change value of highway=unclassified into highway=residential) or new tags are added or existing ones are removed this is referred to as a modification of the tags.

{
    "type" : "Feature",
    "geometry" : {
      "type" : "LineString",
      "coordinates" : [
        [
          8.7043422,
          49.4073557
        ],
        [
          8.7040734,
          49.4073795
        ],
        [
          8.7040557,
          49.4074098
        ],
        [
          8.7039578,
          49.407403
        ],
        [
          8.7039631,
          49.407358
        ],
        [
          8.7038376,
          49.4073445
        ],
        [
          8.7038279,
          49.4072945
        ]
      ]
    },
    "properties" : {
      "@changesetId" : 39206946,
      "@contributionChangesetId" : 39206946,
      "@osmId" : "way/171574589",
      "@osmType" : "way",
      "@tagChange" : true,
      "@timestamp" : "2016-05-10T06:07:24Z",
      "@version" : 2,
      "climbing:boulder" : "yes",
      "climbing:quality" : "solid",
      "climbing:rock" : "sandstone",
      "climbing:sport" : "yes",
      "name" : "Riesenstein - Massivwand",
      "natural" : "cliff",
      "source" : "HiRes aerial imagery",
      "sport" : "climbing"
    }
}

Geometry Change#

Users can also modify the geometry of existing objects in OSM. The geometry can be changed by moving nodes (for all feature types node, way and relation) or by adding or removing nodes (for feature types way and relation). A change in the geometry will most likely cause a change (increase or decrease) in derived statistics such as length or area.

{
  "type": "Feature",
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          8.6711797,
          49.4153706
        ],
        [
          8.6712539,
          49.4153699
        ],
        [
          8.6712536,
          49.4153546
        ],
        [
          8.671297,
          49.4153542
        ],
        [
          8.6712972,
          49.415365
        ],
        [
          8.6713282,
          49.4153647
        ],
        [
          8.6713285,
          49.4153768
        ],
        [
          8.6713421,
          49.4153767
        ],
        [
          8.6713424,
          49.4153916
        ],
        [
          8.6713602,
          49.4153914
        ],
        [
          8.6713617,
          49.4154958
        ],
        [
          8.6713259,
          49.4154959
        ],
        [
          8.6713266,
          49.4155554
        ],
        [
          8.6713853,
          49.4155552
        ],
        [
          8.6713859,
          49.4156099
        ],
        [
          8.6713251,
          49.4156102
        ],
        [
          8.6713253,
          49.4156295
        ],
        [
          8.6712742,
          49.4156298
        ],
        [
          8.6712727,
          49.4154976
        ],
        [
          8.6711817,
          49.4154981
        ],
        [
          8.6711797,
          49.4153706
        ]
      ]
    ]
  },
  "properties": {
    "@changesetId": 38720858,
    "@contributionChangesetId": 38720858,
    "@geometryChange": true,
    "@osmId": "way/28890082",
    "@osmType": "way",
    "@timestamp": "2016-04-20T07:47:15Z",
    "@version": 6,
    "natural": "water",
    "water": "pond"
  }
}

Deletion#

Whenever an object is removed from the OSM database this is referred to as a deleted object.

{
    "type" : "Feature",
    "geometry" : null,
    "properties" : {
        "@changesetId" : 40626906,
        "@contributionChangesetId" : 40626906,
        "@deletion" : true,
        "@osmId" : "way/378899148",
        "@osmType" : "way",
        "@timestamp" : "2016-07-10T09:56:35Z",
        "@version" : 2
    }
}

Slides and Video

Video in HeiCAST