Proposal:House numbers/Karlsruhe Schema: Difference between revisions

From OpenStreetMap Wiki
Jump to navigation Jump to search
(→‎usage: fix layers in link)
Line 101: Line 101:
</source>
</source>
</div>
</div>




Nodes that do not have an integer-value for their addr:housenumber-tag are ignored for interpolation. (e.g. "12b").
Nodes that do not have an integer-value for their addr:housenumber-tag are ignored for interpolation. (e.g. "12b").


We use linear interpolation along the way between any 2 consecutive nodes that represent an integer house-number.
We use linear interpolation along the way between any 2 consecutive nodes that represent an integer house-number.


House-numbers that are tagged as a single node always take pecedence over interpolated ones and are skipped in interpolation (e.g. Interpolation from 1 to 20 will skip the 12 if there is a single node/building-polygon for house-number 12).


For missing house-numbers (e.g. missing "12") two ways need to be drawn (e.g. "1-11" and "13-25").
For missing house-numbers (e.g. missing "12") two ways need to be drawn (e.g. "1-11" and "13-25").

Revision as of 16:24, 10 November 2008

Template:Language-Karlsruhe Schema This schema is used for first tests of tagging house-numbers.

You may use or ignore it. This is how we do it.

Housenumber-karlsruhe-de.png

It can be changed at any later time after everyone has gathered experience with tagging house-numbers and interpreting the mapped data.


Basics

Houses are geolocated next to streets. As such they are related to a way for their postal address but contain their own geolocation independent of their street.

In OSM parlance:

  • A house is, generally, represented by a node next to (not on!) the street.
  • Special ways may be introduced between houses to indicate that house number interpolation should take place (i.e. the system should assume that between house 10 and house 20 there are also 12, 14, 16, 18 or so).

simple case

For the most common case we need to keep the work and entry-barrier for mappers low.

Tags

We use the following tags:

Tag required Element-Type Values Description
addr:housenumber required node area string the house-number
addr:street optional node area string the (main-)name of the related street
addr:interpolation required way even/odd/all how to interpolate the housenumbers belonging to the way along the related street
addr:full optional node area string full postal address
addr:postcode optional node area string postcode of the building/adressed area
addr:city optional node area string city as used in postal addresses of the building/adressed area

Usage

single house as a node next to the way

NodeNextToRoad.png

<node id="1">
  <tag k="addr:housenumber" v="10" />
</node>

The location on the way is calculated by finding the nearest point on the nearest street.

single house as a building polygon

HousePolygonNextToRoad.png

<way id="1">
  <tag k="addr:housenumber" v="10" />
  <tag k="building" v="(yes|apartments|...)" /> 
</way>

This case is the same, we just use a polygon for the house. Where a single point is needed for calculation, the middle of the bounding-box is used.

Many houses along a way

HouseNumbersInterpolation.png

Parallel to the way representing the street we construct n nodes connected by their own way. This way has the sole use of describing the fact that house number interpolation should take place between the connected nodes (and what numbering scheme to use for interpolation).

<node id="01" lat=... lon=...>
  <tag k="addr:housenumber" v="10" /> 
</node>
<node id="02" lat=... lon=...>
  <tag k="addr:housenumber" v="20" /> 
</node>
<node id="03" lat=... lon=...>
  <tag k="addr:housenumber" v="100" /> 
</node>
<way id="??">
  <node ref="01"/>
  <node ref="02"/>
  <node ref="03"/>
  <tag k="addr:interpolation" v="even" />
</node>

Nodes that do not have an integer-value for their addr:housenumber-tag are ignored for interpolation. (e.g. "12b").

We use linear interpolation along the way between any 2 consecutive nodes that represent an integer house-number.

For missing house-numbers (e.g. missing "12") two ways need to be drawn (e.g. "1-11" and "13-25").

We expect this "interpolation way" to be a temporary construct. In the long run, OSM will have every single house mapped as a building outline, and every single house will be tagged with its house number, so that interpolation ways will gradually vanish. However they are good to make a quick start with house numbers, and reportedly there's existing data waiting to be imported that will also require interpolation.

(optional) giving hints for choosing the street

Case: Selecting the street a house belongs to

HousePolygonNextToRoadWName.png

Street-names (easy for humans)

<node id="1" lat=... lon=...>
  <tag k="addr:housenumber" v="10" /> 
  <tag k="addr:street" v="AStreet" /> 
</node>

Only ways with a "highway"-tag are called streets. (e.g. this will not associate a numbered house with the polyline of a fence, wood or power-line)

Case: Relations (easy for computers, difficult for humans)

Tags

Key Value Discussion
type associatedStreet
name streetname optional?!?! for easier use of josm :)

Members

Way or Node Role Recurrence? Discussion
way street one The associated street
node way house one or more One or more house numbers


Computers can easily add these relations where they are missung while pre-processing a bounding-box for searching.

<node id="1" lat=... lon=...>
  <tag k="addr:housenumber" v="10" /> 
</node>
<relation id="??">
  <tag k="type" v="associatedStreet" /> 
  <member type="node" ref="11" role="house" />
  <member type="way" ref="???" role="street" />
</relation>

Hint: Computer-programs that need to navigate house-numbers can create these relations internally from the first case as a step in pre-processing.

Case: Selecting the street a house represented by it's building-polygon belongs to

HousePolygonNextToRoadWRel.png

<node id="11" lat=... lon=...> 
  <tag k="addr:housenumber" v="10" />
  <tag k="addr:street" v="AStreet" /> 
</node>

or

<source lang=xml>
<relation id="??">
  <tag k="type" v="associatedStreet" /> 
  <member type="node" ref="11" role="house" />
  <member type="way" ref="???" role="street" />
</relation>

Case: Selecting the street the series of house-numbers belongs to

<node id="1" lat=...lon=...>
  <tag k="addr:housenumber" v="10" /> 
  <tag k="addr:street" v="AStreet" /> 
</node>
<node id="2" lat=... lon=...>
  <tag k="addr:housenumber" v="20" /> 
</node>
<node id="3" lat=... lon=...>
  <tag k="addr:housenumber" v="100" /> 
</node>
<way id="11">
  <nref id="1"/>
  <nref id="2"/>
  <nref id="3"/>
  <tag k="addr:interpolation" v="even" />
</way>

or

<relation id="??">
  <tag k="type" v="associatedStreet" /> 
    <member type="way" ref="11" role="house" />
    <member type="way" ref="???" role="street" />
</relation>

(optional) giving hints about the full address

<node id="01" lat=... lon=...>
  <tag k="addr:housenumber" v="10" />
  '''<tag k="addr:postcode" v="832989" />'''
  '''<tag k="addr:full" v="First Street 10
                           832989 My Town
                           France" />'''
</node>

(optional) giving hints about the road-access

<relation id="??">
  <tag k="type" v="roadAccess" />
  <member type="way" ref="11" role="accessto" />
  <member type="node" ref="11" role="accessvia" />
  <!-- (optionally multiple <member type="node" ref="11" role="accessvia" />
        for multiple access-locations to the adressed place e.g. for
        convention-centers) -->
  <member type="way" ref="???" role="accessfrom" />
</relation>

Where the access-node may be a node on the street (trivial) or a node next to the street (e.g. gate). In this case we interpolate a nearest location on the street, like we would do for the house-node without this relation.

usage

  • Some streets in Karlsruhe have their house-numbers tagged this way. Also some other places have such data.
  • Traveling Salesman has a commandline-application org.openstreetmap.osm.data.searching.HouseNumberFinderTest to search for street+house-number and get a geolocation of the single house.
  • Osmarender is patched to render the house-numbers very pretty: single houses, interpolation
  • JOSM has a preset for easily setting addr:* tags