Skip to content

Search index: keep the tents tag and check the shelter filter #3294

Closed

Description

@timohueser

Status: done
Size: S
Part of #3286. Depends on #3290.
Systems: search, route-planning

TL;DR

Goal: After the next build of the search index and the place tiles, the planner shows no caravan site and no camp site that takes no tents: not on the map, not in a search, not by its name.
Problem: The index does not keep the OpenStreetMap tag tents, so a site with tourism=camp_site and tents=no is a campsite for the planner. Caravan sites (tourism=caravan_site) are in the place group camp, so the map shows them under "Campsites". The tag shelter_type is dropped in the same way as tents, so the rule of records.py that sorts picnic shelters and bus shelters out of the shelters never applies to real data.
Decision: The owner decided that caravan sites go completely: a place where a rider cannot pitch a tent is of no use for cycling or hiking. The index keeps the tags tents and shelter_type. A camp site with tents=no is treated as a caravan site. A caravan site gets no record in the search index and no place in the place tiles, and the clients have no kind for it. The change lands now and takes effect with the next index build; this issue starts no build. Until then, #3317 already keeps caravan sites out of the searches for campsites and for places to sleep. (Review page, finding 07 step 2.)

Plan

  1. host/obc-search-bake/src/features.rs: the tag filter keeps a tag only when its key is in the matches! list. Add tents and shelter_type to that list. places.rs already copies shelter_type into extra, but the tag never reaches it.
  2. host/obc-search-bake/src/places.rs: add tents to the keys that go into extra.
  3. planner/search/records.py: category gives the kind caravan_site to a place with osm_value == 'camp_site' and extra.tents == 'no', as it does for tourism=caravan_site. The code that writes the records leaves out every place of the kind caravan_site. Find that place in the build (records.py, pois.py, writer.py) and put the rule in one spot.
  4. planner/search/place-kinds.json: delete caravan_site from the group camp. This file sets which places the map shows under "Campsites" in the baked place tiles (tools/planner_places.py) and in the clients. Check that tools/planner_places.py then writes no caravan site, and that a camp site with tents=no is left out there too.
  5. Delete what is dead after that: the label of caravan_site in builder/web/src/lib/planner/poi-kinds.json, the entry in planner/search/query/schema.py if one is left, the caravan record of planner/search/test/query.test.mjs, and each other reader that grep -rn caravan finds outside target/, node_modules/ and fixtures/. Leave companion-ios/Packages/OBCKit/Sources/OBCFormats/WaypointSymbol.swift alone if its symbol belongs to the device format and not to the planner; say what you found.
  6. Tests: one case in the tests of obc-search-bake that both tags reach extra; one in planner/search/test/build.test.mjs that a caravan_site place and a tents=no camp site get no record, and that a camp site without the tag stays a campsite.

Done when

  • obc test -p obc-search-bake
  • The build tests of planner/search/README.md pass.
  • The pull request says that the change needs the next index build to take effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions