[josm-dev] connected nodes in blue

Shaun McDonald osm at shaunmcdonald.me.uk
Mon Apr 27 11:05:25 BST 2009


Hi,

On 27 Apr 2009, at 05:04, j2megps wrote:

>
> Quote:
> <<<
> Problem here is, that currently nodes don't kwow any ways and ways  
> don't
> know each other. So I really hesitate to do a bigger data model change
> only to implement this feature - who knows what it will brake.
>>>>
>
>
> The actual problem here is not in JOSM, it is in OSM data model:  
> "OSM data
> model was not designed to store routing nodes in database " so way  
> does not
> know how to link to other ways.

Can you please explain why it is that there are several routing  
engines using OSM data already, including a JOSM plugin?
The problem is with the way that JOSM stores the data. JOSM could have  
a List of references to the ways that are joined to the node, however  
this would increase the memory usage. You should also remember that  
the OSM data model was designed for routing from the outset.

If you use the web site code, you can easily find the ways connected  
to any other way using the following code.
way.nodes.each do |node|
   node.ways
end

>
> We can fix this problem by adding one simple tag to node's data  
> model as
> follow:
>
>  <node id="107629" lat="51.5108175" lon="-0.0867067" version="3"
> changeset="867683" user="j2megps" uid="7037" visible="true"
> timestamp="2009-03-29T12:28:34Z">
>    <tag k="highway" v="routing_node"/>
>  </node>
>
> If you don't like <tag k="highway" v="routing_node"/>, we can use <tag
> k="routing_node" v="yes"/>

This doesn't help any, it would just bloat the OSM data with  
unnecessary information. All nodes are routing nodes. Whether they can  
be routed over, is determined by their tags, the tags of the ways that  
are linked to it, and the routing engine used.

>
> By adding this tag "routing_node" to node "107629", all the ways  
> that have
> reference to this node id "107629" will know they are linked  
> together and
> JOSM will know how to render routing node "107629" different from  
> other
> normal nodes. We can even render routing node in different color  
> depend on
> its cardinality, for example in my application I render blue color for
> routing nodes that have link to 1 other routing node, green color for
> routing nodes that have link to 2 other routing nodes, yellow color  
> for
> routing nodes that have link to 3 other routing nodes, purple color  
> for
> routing nodes that have links to 4 other routing nodes and red color  
> for
> routing nodes that have links to 5+ other routing nodes.
>

Cycle Streets already has a rendering of something similar for  
internal usage (it hasn't been made public because the implementation  
is inefficient. It would be great to have this same functionality in  
the editors.

Shaun





More information about the josm-dev mailing list