Commit Graph

26 Commits

Author SHA1 Message Date
Bryan Housel 2b2a71f597 Don't pre-resolve and index complex locationSets into GeoJSON.
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.
2022-10-28 10:49:01 -04:00
Martin Raifer c8a3cf154b make more cdn's and API urls/settings configurable
* CDNs for OCI, NSI, etc.
* OSM API (URL and oauth API settings)
* taginfo API
* nominatim API
2022-10-14 19:19:29 +02:00
Bryan Housel 3b3f80f690 Improve the checking of results from the NSI matcher..
(fixes: https://github.com/osmlab/name-suggestion-index/issues/5693)

Previously the code would accept the first useful match, however this match
might be an "alternate" match.  Now we keep iterating until we find a "primary"
match.

This bug could cause the validator to suggest upgrading well-tagged features to
a less wanted feature type.  For example a "Tesla Supercharger" would flip to
a "Tesla Destination Charger" if it had "Tesla" anywhere in its list of tags
(because `short_name=Tesla` is an "alternate" match for both destination
chargers and super chargers)
2021-11-29 16:49:36 -05:00
Milos Brzakovic 021107cb81 Merge pull request #8642 from openstreetmap/testing_data
Test improvements
2021-09-28 11:08:31 +02:00
Milos Brzakovic a00a9162e7 Merge branch 'develop' into tag_as_not 2021-09-27 19:03:46 +02:00
Bryan Housel bb84962e5d Only insert sources into the fileMap if not already there
This allows us to setup the fileMap correctly for testing so
that it never tries to fetch assets from the CDN.
2021-08-16 13:28:55 -04:00
Bryan Housel 52e8555a8f Add a validator fix option to tag as not: a matched item
(re: #6577)
2021-08-06 12:26:19 -04:00
Bryan Housel 0f913113c7 Match a 'route_master' as if it were a 'route'
This code just treats `type=route_master` relations as if they were `type=route`
so they will match the transit networks in NSI.

(closes https://github.com/osmlab/name-suggestion-index/issues/5184)
2021-08-05 22:05:11 -04:00
Bryan Housel 15ee63e875 Improve code for keeping only interesting key/value pairs
Before it was not actually checking that the osmvalue was in the vmap,
so we were testing a bunch of pairs like `highway/crossing` and
`highway/residential` that would never match a NSI category.
2021-08-05 16:59:07 -04:00
Bryan Housel 1d5c8253be NSI matcher shouldn't treat old_name like a name tag
(closes #8617)
2021-08-02 12:21:34 -04:00
Bryan Housel bd97df6aac In general, preserve existing values for tags that can be toplevel
We'll only _replace_ the tag value if this tag is the toplevel/defining tag for the matched item (`k`)
(closes #8615)
2021-08-02 12:07:13 -04:00
Bryan Housel 8db1c1f7f5 Construct URL to match version number that package.json has
https://github.com/openstreetmap/iD/pull/8305#discussion_r663037548
2021-07-02 10:27:50 -04:00
Bryan Housel 896d14ba80 Upgrade to name-suggestion-index v6
Also bump country-coder and location-conflation
2021-06-24 16:41:50 -04:00
Bryan Housel add11432d3 More sophisticated name/branch splitting
(re: https://github.com/openstreetmap/iD/pull/8305#issuecomment-805454952)
2021-03-24 18:03:37 -04:00
Bryan Housel 55d9da9480 Improve logic for matching name fragments like TUI ReiseCenter
(re: https://github.com/osmlab/name-suggestion-index/issues/4543#issuecomment-799732746)
2021-03-22 20:23:22 -04:00
Bryan Housel 77e7620ab8 Switch to published NSI v5 🎉 2021-03-22 14:39:58 -04:00
Bryan Housel f5b6024988 Revise name/branch splitting code
This now breaks the name into fragments and reruns the fragments against the NSi matcher
rather than using flaky regular expressions. Has a few advantages:
(re: https://github.com/osmlab/name-suggestion-index/issues/4543#issuecomment-797577999)
2021-03-12 15:03:50 -05:00
Bryan Housel d282140999 If we match a generic name, stop looking
This is for "nextbike"
(re: https://github.com/osmlab/name-suggestion-index/issues/4543#issuecomment-796126041)
2021-03-11 17:51:09 -05:00
Bryan Housel 98a622f41a Make sure a name is either primary or alternate (can't be both) 2021-03-11 17:46:09 -05:00
Bryan Housel 19a8fd16d2 Be smarter about identifying what tree an osm feature might be in
Needed this after I added `highway=bus_stop` to the transit tree
2021-03-11 16:28:26 -05:00
Bryan Housel a827e13a6d Be less aggressive about removing toplevel tags
(re: https://github.com/openstreetmap/iD/pull/8305#issuecomment-792871448)
2021-03-08 11:36:41 -05:00
Bryan Housel 7a82dba825 Only match alternate amenity/yes if it actually is tagged that way 2021-03-05 10:59:15 -05:00
Bryan Housel 3f8faec413 Improvements to name gathering
- Actually bail out properly if namelike values contain semicolon ';'
- Prioritize the canonical tags like `brand:wikidata`, `operator:wikidata`
- Don't insert a name into 'alternate' set if it's already in 'primary' set
2021-03-05 10:40:06 -05:00
Bryan Housel 1b1bf8eed2 Don't offer upgrades to dissolved items 2021-03-05 10:04:29 -05:00
Bryan Housel bbed217625 For some names, consider splitting name into name and branch.. 2021-03-05 09:54:47 -05:00
Bryan Housel 1f6a2121c4 Move all of NSI into a service, rewrite matcher code 2021-03-03 12:04:37 -05:00