[OSM-talk] Topology (was: OSM the mediocre alternative)
Lars Aronsson
lars at aronsson.se
Mon Apr 30 00:15:45 BST 2007
Schuyler Erle wrote:
> Topology introduces enormous complexity in spatial processing, and
> will slow down storage and querying in a spatial database by at least
> an order of magnitude, even with appropriate caching. With that in
> mind, I wonder if it wouldn't make more sense to store feature
> geometries as simple geometries, but continue to represent transport
> network intersections as separate objects (as OSM currently does).
> This approach might make it possible or even easy to model attributes
> of the intersection, such as turn restrictions and the like.
I think that a possible way forward, starting with the current
data model, would be to tweak the definition of a "line segment"
to mean a geographic path of coordinates, i.e. to allow "knees" to
be inserted into a line segment without being "nodes" in their own
right. These knees would not get node IDs. Moving a knee in an
editor would be a separate operation from moving a node. Knees
would only be stored within the line segment object (*), and
outside objects can not directly address a knee inside a line
segment. Editors would need a method to convert a knee into a
node, thus splitting the line segment into two, for the purpose of
making an intersection of connecting roads.
This would make the current, rather simple data model more
complex. So what would the benefit be? The benefit would be the
"order of magnitude" faster spatial processing claimed by Schuyler
in his first sentence above. But is this claim real? How can we
get a better understanding of that? Where is the evidence or the
introductory text book for implementing GIS algorithms?
(*) I'm not going into detail of how this should be represented
in a database. In the XML database dump (planet.osm), you can
think of <knee>s as list inside the <segment> object, each
specifying their own latitude and longitude.
I think it is possible now already to identify potential "knees",
i.e. nodes with only two connecting line segments, both within the
same way and in sequence, in the latest planet.osm dump. Then you
can convert it into a planet-with-knees dump that people can play
with. How many nodes would become knees? How much would the
average nodes-per-way count decrease?
After this modification, we would still have ways as a collection
of line segments, just like today. The only difference would be
that some of the line segments in a way might contain knees.
--
Lars Aronsson (lars at aronsson.se)
Aronsson Datateknik - http://aronsson.se
More information about the talk
mailing list