We do indeed have twice the node count (and twice the relationship
count). This is a necessary side effect of the fact that an OSM node
can participate in more than one way (at intersections as well as
shared edges of polygons, etc.). In addition, with shared edges the
direction can be reversed from one way to the other, so we need a
completely separate set of nodes and relationships to model one way
versus the other. We have considered a compacted version of the graph
where we only use the extra nodes and relationships when they are
needed, but the code to decide when they are needed or to convert the
subgraph to the expanded version when needed (ie. when a new joined
way is loaded) would be much more complex, and therefor susceptible to
bugs. We choose a cleaner, simpler code base over a more complex, but
more compact graph.

Now we also want to model historical changes. It appears that the use
of multiple nodes/relationships will also allow us to model this, so
it is a good thing (tm) :-)

For routing, I would create a set of relationships connecting directly
all nodes that are intersection points, and ignoring all the nodes
along the way. We can add edge weights to these new relationships for
the distance traveled, or other appropriate weighting factors (type of
road, possible speed, hinderences, etc.). This graph would be ideal
for routing calculations. The main OSM graph is not ideal for routing,
but is designed to be a true and accurate reflection of the original
OSM data and topology stored in the open street map database. With
Neo4j we can do both :-)

These routing relationships have not been added to the current OSM
model in neo4j-spatial, but would be relatively trivial to add (if we
ignore advanced concepts like turning restrictions). They could be
added by the OSMImporter code that identifies intersections, with only
a few lines of extra code (I think ;-)

On 12/6/11, danielb <danielbercht...@gmail.com> wrote:
>
> craig.taverner wrote
>>
>> ...
>> - Create a way-point node for these
>> ...
>>
>
> Hi together,
>
> I wonder why to add extra nodes to the graph (if I understand Craig
> correctly)? Wouldn't you then end up in expanding twice the node count
> (way-point nodes and OSM nodes themself, because you have to query the OSM
> id (or any other identification value of the end node) in every expand and
> lat / lon if you don't have precompiled edge weights)? I would just connect
> the OSM nodes directly with new edges to form a routing subgraph.
>
> Best Regards,
> Daniel
>
>
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-path-finding-using-OSM-ways-tp3004328p3564688.html
> Sent from the Neo4j Community Discussions mailing list archive at
> Nabble.com.
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to