[OSM-dev] I've done some work on JOSM...

Ed eAi at opencoding.net
Fri Apr 27 05:55:24 BST 2007


Hey all,

I'm new around here (just found this project today), but I've been 
speaking to various people on IRC and thought I'd try to put some work 
in on JOSM, if nobody minds...

So, as a complete newbie to this, I started trying to add some roads in 
my area. There were some incomplete roads there, so I made them into 
ways (with some help from people on IRC, it isn't exactly obvious!). 
Anyway,  then started having validation warnings about "Unordered ways", 
which I was told could be fixed using "Reorder Segments". This didn't 
work for me, so I decided to look into the code.

So, the code for Reorder Segments seems to rely on all the segments 
facing the same way, or it won't work properly - it'll order the parts 
that are facing the same way, but not the whole thing (as would be 
expected, you can't order them when they aren't facing the same way). 
So, to fix this (from my point of view anyway), I've gone and written a 
new function I've called "Direct all way segments", that seems to solve 
all the "Unordered ways" warnings (that are really unordered ways, and 
not other issues like roads being split in two).

What it essentially does is to Sort all the segments in a way 
irresepective of the direction they're facing, it then makes all of them 
face the same direction as the one on the end, it then reorders the 
segments in the way. I think this is considerably easier than the 
previous method which involved selecting each segment, switching it then 
reordering them.

I'm not sure what process there is for reviewing patches (if any), or 
what I should do with this code.

Ed / eAi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DirectAllWaySegmentsAction.java
Type: text/x-java
Size: 5699 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20070427/aee2a9b3/attachment.java>


More information about the dev mailing list