[OSM-talk] conclusions from my postgres / postgis experiments

Robert (Jamie) Munro rjmunro at arjam.net
Thu Nov 23 14:28:31 GMT 2006


raphael Jacquot wrote:
> here's what I found during my little^Wextensive experiment:
> 
> 1) we have tons of duplicate segments
>      ((s1.from = s2.from) AND (s1.to = s2.to)) OR
>      ((s1.from = s2.to) AND (s1.to = s2.from))
> 2) we have 4000+ degenerate segments
>      (s.from = s.to)
> 3) we have ways with no segments

Can we just write a script to delete them (except for case 1 where the
segments appear inside a way)? Database rules should be applied to make
sure they can't happen again. This may necessitate moving away from
MySQL. :-)

> 4) we have degenerate ways where the way is neither a proper linear 
> feature nor a proper closed polygon, but rather an unwidedly spaghetti 
> monster. most of those furthermore involve a loop of some sort...

These should be allowed. For rendering, I would suggest the following
algorithm:

* Go through the segments in the order they are in the DB.
* add all the segments until you reach one that doesn't start where the
last one ended.
* Use what you have at this point to decide where to put the road name etc.
* Add the other segments

That way, people can control where the road name will be rendered on
split ways by making sure that the segments that want to share the name
come first in the list. By default, editors should try to find the
longest path and put that at the start of the list. It would be nice if
josm could display this information somehow (little numbers next to
segments when a way is selected, maybe), and have an easy way to reorder
segments in ways, either automatically or manually.

Robert (Jamie) Munro

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20061123/35a32cf1/attachment.pgp>


More information about the talk mailing list