[josm-dev] JOSM Jumbo patch v8 (JOSM and validator enhancements)

Dave Hansen dave at sr71.net
Tue Jan 29 20:46:36 GMT 2008


My basic motivation here is to have the validator detect and fix all of
the things that I've been doing manually, especially with the TIGER
data.

So, if you have any horribly repetitive tasks in JOSM that you'd like to
automate, I want to hear about it.  I'd be happy to add things to this.
For instance, I'd like to write a "short way" merger.  There's a bunch
of coastline in the US with 2 or 3 nodes per way.  It's much easier to
manage and fix that stuff up when those are longer.  So, I'd like to
merge ways together that are adjacent (share direction and an endpoints)
and have all the same tags.

I'd love to get this merged into JOSM, but JOSM development is pretty
slow these days, and it turns out not to be too much trouble to keep my
patches merged up to date with the latest JOSM. 

Binaries and patches here:

	http://dev.openstreetmap.org/~daveh/josm/008/

Please give it a try if you like, and let me know if you have any
troubles.  I'll be happy to investigate and fix bugs. 

JOSM core changes:
* remove unused imports
* replace all add/remove node in a way operations with accessors
  to new way functions.  This lets us:
* implement reverse lookup in a static class.  It caches the node->way
  accesses so first accesses are slow but subsequent ones are fast. 
  * Doesn't bloat Way or Node objects.
  * Reduces code bloat in validator (lots of tests did this alone)
  * uses preference: reverse-lookup=always/never/cache
   * 'always' will create the cache from the start, and keep it up to
     date always.
   * 'never' will always use the slow back-reference collector
   * 'cache' will use the slow one the first time, then the cache after
     that. (this is the default)
* make Way.nodes an immutable list to detect all accesses which
  don't use the Way class's function
* Add quite a few little helper functions to Way.
* add Main.debug() function for messages
* Add a bunch of new Commands.  These let you do much more granular
  things with objects, and don't suffer from the concurrent modification
  issues that ChangeCommand() does.
  * Fixes validator bug: "The fix duplicated nodes function seems to
    return 412 errors when uploading the nodes"
* add retries to uploads
* give better progress in upload dialog
* add Bounds::contains() function
* change Commands to be able to return success/failure, which will
* allow SequenceCommand() to detect errors, and roll back all operations
  which were performed before that one errored out
* teach Way/Node merging about TIGER tags (this allows good merging at
  TIGER county borders)

Validator:
* New checks:
   * Empty ways (ways with 0 nodes) (fixable)
   * MotorwayLinksMustTouchMotorways, don't let motorway_links exist
     unless touching a motorway (lots of these in TIGER)
   * MotorwayIntersections: motorways may only touch motorway_links
     and other motorways, except at their endpoints (fixable)
   * DuplicateSegment: for ways that re-use the same node pair
* Rewrote coastlines checks:
   * check for "forks" in coastline
   * ensure coastline is ordered (these are fixable now)
   * check for "ends" of coastline inside the current layer
* consider TIGER tags in UntaggedNodes
* Basically rewrote DuplicatedNodes to allow multiple nodes at the same
  spot if they are different types (highway, power, railway, etc...)
* Use new granular Commands from core
* Make OverLapping ways fixable
* Take different types of ways into account in CrossingWays


-- Dave





More information about the josm-dev mailing list