Can a way contain the same node more than once and not be a simple loop? I know the following is possible: 1-2-3-4-5-1 But can you do this? (The following could, for example, produce a P-shaped way) 1-2-3-1-4-5 Thankyou Gary asked 12 Jul '10, 13:01 gsteinert |
Yes thats possible but in my Opinion there are very few cases where this makes sense. in my opinion it is better to split the way. answered 12 Jul '10, 13:11 Islanit |
Yes, that is possible in the OSM API. Nodes can appear as many times as you like within the same way. You can even do figure of 8 ways that join in the middle. These are most useful for lines like roads, rather than areas, as for areas what's inside and outside can become confusing. Of course there's no guarantee that all tools out there will support every configuration of way you create, and just because you can doesn't mean that you should :-) So keep it simple. I've used P-shaped ways before but nothing more complicated. answered 12 Jul '10, 13:23 randomjunk 1
I think we should distinguish between "crossing" and "touching". "Touching", like in the "P" case is ok and there are good uses for that, for instance a road ending in a turning circle. But I haven't come across any case where it actually makes sense for a way to cross itself. A closed way (for instance a roundabout or an area) is just a form of a way touching itself.
(16 Jul '10, 09:33)
Jochen Topf
1
Indeed. The question was specifically about using the same node more than once in a way.
(16 Jul '10, 10:35)
randomjunk
|
As already stated it's technically possible to create a way in OSM that contains a node more than once. It's usually considered faulty and tools like JOSM validator or the numerous quality check tools will report such self-intersecting ways. That relates to constructions like a 'P' or '8'. It does not apply to closed ways creating areas. That is a way where the first and last node are the same. You will use the later to map buildings or lakes. Some quality checks that list self-intersections are: http://wiki.openstreetmap.org/wiki/Self_intersecting_way_reports http://wiki.openstreetmap.org/wiki/OSM_Inspector/Views/Geometry#Fix_self-intersecting_ways answered 12 Jul '10, 20:14 Stephan Knauss randomjunk |