Search notes:

OpenStreetMaps: nodes, ways, relations and tags

Nodes, ways, relations and tags are the fundamental data structures in OpenStreetMap:
Each of these objects has a few properties
Then, there are also tags which are textual key value pairs to describe what nodes, ways and relations actually are in the real world.

Tags

Colons

A colon typically specifies a hierarchical nature (name, name:en, name:de…)

Real-world and other attributes

Most tags describe real-world features.
Other tags, such as source or created_by are not related to the physical thing being mapped.
And then there are also some tags such as note, description, fixme, start_date, survey:date etc.

Implication of tags on ways

Some tags, when applied on ways, imply a multipolygon (for example: landuse) while others imply lines (such as highway).
There are even cases, where a tag can imply both (man_made=pier).

Changesets

A changeset records metadata

Relation

type attribute

A relation's type can be specified with the type tag. Allegedly, 99% of all relations have this attribue set.
The most often seen attributes are:
multipolygon Relations whose type is multipolygon should only have way, but no node members. The roles of the members should be inner or outer
restriction Essential members are those with a via tag.
route Public transport routes, hiking and biking routes etc.
boundary Boundaries can often be understood as multipolygons. A node member (admin_centre) lables the boundary.
associated street Points to a node with tags to make sense.
public_transport
site
destination_sign Structurally similar to restriction.

Using APIs to query data related to nodes, ways or relations

OSM API

The data of a way (or node or relation) can be queried with the OpenStreetMap API, for example like so:
curl -s -X GET https://api.openstreetmap.org/api/0.6/way/1154969870

Overpass API

The data related to a given node can be queried using the Overpass API with the following query:
node(26863664);
out;
In addition, the Overpass API provides areas as an extension to the three basic OSM data types nodes, tags and relations.

Historical notes

The current OSM data model (nodes, ways, and relations) has evolved from an earlier model with
In 2005, segments were removed an relations were added.
Apparently, there was some support for an area datatype before this change. But with the removal of segments, the area datatype is gone, too.
Changesets were introduced in 2007.

Limits

There are some limits, for example:
Such limits can be queried using the OSM API request GET /api/0.6/capabilities:
$ URL=https://api.openstreetmap.org
$ VERSION=0.6
$ API=$URL/api/$VERSION
$ curl $API/capabilities
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
  <api>
    <version minimum="0.6" maximum="0.6"/>
     …
    <waynodes maximum="2000"/>
    <relationmembers maximum="32000"/>
     …
    <status database="online" api="online" gpx="online"/>
  </api>
    …
</osm>

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759399985, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/OpenStreetMap/nodes-ways-relations(163): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78