Hi, > > Could the algorithm be moved into the JOSM validator plugin? That might > > make it quite a bit easier to edit things in fewer steps. > > I'd love to see it be a JOSM plugin; it would absolutely be easier to use. > Select two ways, hit a button, voila! > > Unfortunately, it is in perl because that's what I know; I've never done > anything in Java yet. I've been wondering if this may be just the time to > learn it. I'm not sure if a JOSM plugin is a good place to start learning > Java or if that is biting off too much to start.
What I'd suggest is that you take a look at the "utils plugin" (http://svn.openstreetmap.org/applications/editors/josm/plugins/utilsplugin). This plugin currently adds one function to the JOSM menu ("simplify way"). The innards of the way simplification are a bit complicated but essentially what it does is: * add a menu option * when menu option called, check if selection contains exactly one way * if yes, simplify way (create new, modified way) If you are a copy-and-paste programmer like I am, then you could easily use that as a base for your "unbraid" function; essentially you want to do the same - add a menu option, check if two ways selected, do something with them, store result. You will see that JOSM is a bit complicated where it comes to changing data; you have to create a new version of the object you want to change and then produce a "change command" that encapsulates the change. But the advantage of this is that JOSM will handle the undo stuff for you for free. One thing that is not in SimplifyWayAction and that you might need is the manipulation of nodes; SimplifyWayAction only drops nodes from a way, it doesn't move nodes around. But that's not a huge thing either. So if you feel the slightest bit adventurous, give that a try! You can create a proper plugin of your own or build your new function into the Validator later on but I'd just leave it in the UtilsPlugin when finished. (IIRC Dave H. has also done quite a bit of TIGER related work on JOSM so he should be able to guide you through it...) Bye Frederik -- Frederik Ramm ## eMail [EMAIL PROTECTED] ## N49°00'09" E008°23'33" _______________________________________________ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk