This was taking a lot of time at app startup.
Instad now we resolve and index only the include and exclude parts.
We can still determine the valid locationSets at runtime in `locationSetsAt()`
by checking the `_locationIncludedIn` and `_locationExcludedIn` caches.
This also upgrades the locationManger to an ES6 class.
This also includes some hacky code in nsi.js so that the NSI will continue to work.
The NSI matcher can build its own location index, but it doesn't need to do this.
We monkeypatch a few of the matcher collections to work with the new LocationManager.
this makes sure that the map extent is known when deciding which background imagery to load (e.g. which are valid in the viewport or which is the "best" one)
re: the fix for #8632 - we can't actually skip validation on these.
The better solution is to move the check to getIssues() so the user isn't
credited for causing the issues unless it's something they actually touched
This fixes a situation where several entities in the queue are involved in a
disconnected crossing, and the first one detects the disconnection, but a
later one clears out that first detection from the cache. Now we clear
caches one time before starting the validation work.
This will catch the situation where an edit or undo affects something related without
actually touching the item - for example an undo can cause a connected way to disconnect
from the main graph.
This can occur if there are several ways disconnected from the graph and
the user fixes these, but then partially undoes their fixes.
The current diff might not contain the entity that fixed the issue
(reconnected the disconnected graph), but they did fix the issue elsewhere.
(closes#8632)
For example, a user can undo some work and an issue will still present in the
head graph, but we don't want to credit the user for causing that issue.
From what I can tell, this code is nearly the same as what the "complete"
difference already gives us - combined nodes from both previous and current,
multipolygon members, parents of nodes/relations
The previous code was grabbing _all_ parent relations, which is too much.
For example: if a user changed a road, the validator was treating it like
the user had changed bus and highway routes along that road.
(closes#8613)
(helps a lot #8612)