mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 18:34:09 +00:00
fix(tours): read e-bike chargers as mapped, keep unnamed ones on the map search
This commit is contained in:
@@ -265,6 +265,13 @@ const KEPT_UNNAMED_ALONG: ReadonlySet<string> = new Set([
|
||||
'ebike_charging',
|
||||
]);
|
||||
|
||||
/**
|
||||
* The kinds the map search keeps unnamed. It wants names everywhere else, but most
|
||||
* e-bike charging points carry neither a name nor an operator, and dropping them
|
||||
* would answer `search_pois` with a fraction of what the tour search finds.
|
||||
*/
|
||||
const KEPT_UNNAMED_EXPLORE: ReadonlySet<string> = new Set(['ebike_charging']);
|
||||
|
||||
/**
|
||||
* What a charging station states, read only where it means something. Every POI
|
||||
* carries `capacity` and `fee` for its own reasons (a restaurant's capacity is
|
||||
@@ -779,7 +786,7 @@ export class OsmClient {
|
||||
// the result count in one round-trip.
|
||||
const query = `[out:json][timeout:${OVERPASS_QUERY_TIMEOUT_S}];\n(\n${selectors}\n);\nout center tags ${cap + 25};`;
|
||||
|
||||
const pois = readPois(await overpassFetch(query), match, osmLang, new Set());
|
||||
const pois = readPois(await overpassFetch(query), match, osmLang, KEPT_UNNAMED_EXPLORE);
|
||||
const truncated = pois.length > cap;
|
||||
const value: PoiSearchResult = { pois: pois.slice(0, cap), source: 'openstreetmap', truncated, clamped };
|
||||
cachePoiAnswer(cacheKey, value);
|
||||
|
||||
Reference in New Issue
Block a user