[OSM-dev] Topologicial correctness in OSM

Nick Black nickblack1 at gmail.com
Wed Jan 17 18:33:56 GMT 2007


Hi,

I dont think thats really what I meant. The issue is:

    |
    |
---*---
    |
    |


So * is the node, which in the OSM model, has Lat, Lon and ID.  ----
and | are roads that intersect - they share the same node ID, which is
how we maintain topological correctness.

TAB files *must* store these relationships, or they would be totally
useles.  I just need to figure out how they (or PG once they are
inported into it) deals with topology...

Nick

On 1/17/07, Nicola Ranaldo <ranaldo at unina.it> wrote:
> On Wednesday 17 January 2007 18:19, Nick Black wrote:
> > Hello,
> >
> > Whilst trying to produce .osm from the brazillian TABs, I've run into
> > a problem, in that the output I can produce output in OSM XML, but it
> > is topologically incorrect, as it duplicates nodes at intersections.
> > My process is:
> >
> > TAB > Import to PostGIS usign ogr2ogr > Script to talk to PG, and
> > input data to OSM MYSQL via dao.rb .
> >
> > One solution to the problem is to go through mysql and compare each
> > lat and lon value to each other, identifying the duplicate nodes and
> > then deleting one set and correcting their parent segment - this seems
> > a rediculous way to do it though.
> >
> > Does anyone have a better idea how to go about it?  I cant see how
> > PostGIS maintains topology, but it obviously does somehow.
>
> I had the same problem and i solved checking for duplicates before adding
> nodes or segments, it's the same but faster.
> I suppose the gis model does not need to maintains a topology as it simply
> uses different layers for data. If a node at lat,lon is traversed by x ways,
> for example by 4 ways, 2 primary and 2 secondary, there will be 3 layers:
> 1) a point layer with the node if it is interesting
> 2) a way layer for primary roads with two linestring objects with all the
> belonging points
> 3) the same but for secondary roads.
>
> If in the same layer two different ways have the same nodes they are
> duplicated too.
>
> Please correct if i'm wrong.
>
>         Niko
>


-- 
Nick Black
--------------------------------
http://www.blacksworld.net




More information about the dev mailing list