42
Towards an Area Datatype for OSM Jochen Topf

Towards an area datatype for OSM - State of the Map 2013

Embed Size (px)

DESCRIPTION

*** Presented by Jochen Topf at State of the Map 2013 *** For the video of this presentation please see http://lanyrd.com/2013/sotm/scpkrr/ *** Full schedule available at http://wiki.openstreetmap.org/wiki/State_Of_The_Map_2013 OpenStreetMap currently does not have a polygon or area data type. Instead areas are usually modelled as closed ways or multipolygon relations (plus some other approaches for special cases). This diversity in solutions for essentially the same problem makes editing and using OSM data much harder than it needs to be. Especially multipolygon relations are difficult to work with and they are quite brittle, leading to a lot of broken data in OSM. The talk will show the problems we currently have when editing and using OSM data. It will describe approaches for a solution with their advantages and disadvantages and the changes necessary to the core database, editors, and applications using OSM data.

Citation preview

Page 1: Towards an area datatype for OSM - State of the Map 2013

Towards an Area Datatypefor OSM

JochenTopf

Page 2: Towards an area datatype for OSM - State of the Map 2013

Fundamental Geometry Types

Page 3: Towards an area datatype for OSM - State of the Map 2013

Point Linestring Polygon

Page 4: Towards an area datatype for OSM - State of the Map 2013

Point Linestring Polygon

Node Way ??

Page 5: Towards an area datatype for OSM - State of the Map 2013

Polygon with Holes

1 outer ring, 2 inner rings

Page 6: Towards an area datatype for OSM - State of the Map 2013

Multipolygon

2 outer rings, 2 inner rings

Page 7: Towards an area datatype for OSM - State of the Map 2013

Definition

A polygondevides

the surface of the planetinto

two regions:

inside - outside

Page 8: Towards an area datatype for OSM - State of the Map 2013

Definition

A polygon is usually described by its border.

The border is a bunch of lines that never intersect.

Border line direction?

Page 9: Towards an area datatype for OSM - State of the Map 2013

Definition

A polygon is usually described by its border.

The border is a bunch of lines that never intersect.

Border line direction?

Page 10: Towards an area datatype for OSM - State of the Map 2013

Polygons in OSM:

There Is More Than One WayTo Do It!

Page 11: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #1:Closed way

Page 12: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #1:Closed way

No holesDepends on tags...

Page 13: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #1:Closed way

highway=residential natural=wood

Linestring or polygon or maybe both...

Page 14: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #1:area=yes

highway=pedestrian highway=pedestrian area=yes

Page 15: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #2:Multipolygon Relation

type=multipolygon

Page 16: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #2:Multipolygon Relation

type=multipolygon

Can have multiple inner and outer rings.

Page 17: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #3:Boundary Relation

type=boundary

Page 18: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #3:Boundary Relation

type=boundary

Role: subarea !

Page 19: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #4:Coastline

Ways connected end-to-end.Land always on left, water always on right.

Page 20: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #5:Riverbank

waterway=riverbank

Page 21: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #5:Riverbank

waterway=riverbank

Page 22: Towards an area datatype for OSM - State of the Map 2013

Polygon Type #5:Riverbank

waterway=riverbank

Page 23: Towards an area datatype for OSM - State of the Map 2013

Types of Polygons

#1 Closed Ways#2 Multipolygon Relation

#3 Boundary Relation#4 Coastlines#5 Riverbanks

Page 24: Towards an area datatype for OSM - State of the Map 2013

Problems

Which polygon type to use?(lakes?, rivers?, boundaries?)

What if several typesare in use at the same time?

Converting from one to another?

Page 25: Towards an area datatype for OSM - State of the Map 2013
Page 26: Towards an area datatype for OSM - State of the Map 2013

Problems withMultipolygon Relations

Tags on relation + outer ways + inner ways

Broken geometries (Self-intersections, ...)

Inner/outer mixups

Subareas

Page 27: Towards an area datatype for OSM - State of the Map 2013

Broken Multipolygon Relations

About 2% broken, another 2% warnings

Page 28: Towards an area datatype for OSM - State of the Map 2013

Polygons in OSM are...

difficult to understand,diffcult to edit,difficult to use .

Page 29: Towards an area datatype for OSM - State of the Map 2013

Some Numbers...

110 million (closed way) polygons 90 million are buildings 72 million have 6 points or less

900,000 area=yes 750,000 natural=coastline (31 million nodes) 260,000 waterway=riverbank

Page 30: Towards an area datatype for OSM - State of the Map 2013

Relations

1,000,000 type=multipolygon 200,000 type=boundary

For together >2 million (multi-)polygons

1,100,000 landuse/natural=* 240,000 boundary=administrative

Largest multipolygon 300,000 points

Page 31: Towards an area datatype for OSM - State of the Map 2013

What are we going to do about it?

Page 32: Towards an area datatype for OSM - State of the Map 2013

A NewArea

Datatype

Page 33: Towards an area datatype for OSM - State of the Map 2013

What Should it Look Like?

Referencing nodes? (Like a way?)(What about huge areas?)

Referencing ways? (A bit like MP relations?)(What about small areas?)

Not referencing anything, coordinates inside?(Like Simple Feature)

Page 34: Towards an area datatype for OSM - State of the Map 2013

Polygons are Problematic...

1. Because there are several ways to accomplish the same thing.

2. Because they are hard to edit and keep valid.

Page 35: Towards an area datatype for OSM - State of the Map 2013

Polygons are Problematic...

1. Because there are several ways to accomplish the same thing.

→ One area datatype

2. Because they are hard to edit and keep valid.

Page 36: Towards an area datatype for OSM - State of the Map 2013

Polygons are Problematic...

1. Because there are several ways to accomplish the same thing.

→ One area datatype

2. Because they are hard to edit and keep valid.

→ Let the computer do the checking

Page 37: Towards an area datatype for OSM - State of the Map 2013

Validation

On the serverIn the editor

Lightweight!?

Check only changes!

Partial download

Check locally

Page 38: Towards an area datatype for OSM - State of the Map 2013

API

Full download of areas not always possible!

Download parts of areas in bbox+

Upload changes of areas in bbox

Page 39: Towards an area datatype for OSM - State of the Map 2013

I think this is doable!

Page 40: Towards an area datatype for OSM - State of the Map 2013

*Details are left as an exercisefor the reader.

Page 41: Towards an area datatype for OSM - State of the Map 2013

Migration

1. Add support for new area type

2. Convert some areas automatically

3. Convert rest manually

4. Remove support for old areas

Page 42: Towards an area datatype for OSM - State of the Map 2013

Thanks!

http://wiki.osm.org/wiki/The_Future_of_Areas

Jochen [email protected]