02 - Outputting data about nodes

This query shows how to create different levels of detail in the output from your query.

The out statement can be controlled by adding some parameters to it. These are appended to the statement.

The parameters can be used to control things like:

  • how much information is extracted about each node (or way, or relation)
  • how geographic information is output
  • sorting and limiting results

In this query we are just looking at the first of these: how to control the level of data provided for each node.

The different parameters are:

  • ids - outputs only the id of nodes
  • tags - outputs only the id and tags attached to a node
  • skel - outputs only the id and geometry
  • body - output id, geometry and tags
  • meta - output id, geometry, tags plus change history

Because they don't output any coordinates, the first two options will cause the IDE to only show you some XML output. It can't generate a map from a list of ids and tags.

Run the query, trying different parameters. You can click around on the map to see the different levels of detail provided for the nodes that are returned.

If you look closely when using the body and meta options, you'll see that the majority of nodes returned don't have any tags.

This is typically because these nodes are being used as members of a way or relation. For example, to describe the location of a road or footpath. They aren't points of interest in their own right.

Links
Source File02-node-output.osm
Authors
  • Leigh Dodds