pelias / pelias/api

reverse: not working on custom layers

Open
#1,678 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
259
Forks
168
Avg merge
6h 15m
Merged PRs (30d)
1

Description

Describe the bug
Custom layers are incompatible with layer filters in reverse queries.

Steps to Reproduce

  1. Import custom data into Pelias from CSV using custom sources and layers.
  2. Perform a reverse query filtered on those layers.
  3. No results.

Pastebin/Screenshots

Pelias request :
.../v1/reverse?point.lat=43.538662&point.lon=1.460511&boundary.circle.radius=0.0001&size=10&layers=stop_area&sources=custom

CSV looks like :

id,source,name,layer,housenumber,street,postcode,lon,lat,addendum_json_custom,category,parent_json
SA_1,custom,Montjoie,stop_area,,,31520,1.4605112727420955,43.5386624143594,"{""network"": ""Tisséo"", ""physical_mode"": ""3""}",network:Tisséo,"{""locality"": [{""id"": ""64"", ""name"": ""RAMONVILLE-SAIN
SA_10,custom,Le Lac Reynerie,stop_area,,,31000,1.4040756476682126,43.56748734995478,"{""network"": ""Tisséo"", ""physical_mode"": ""10""}",network:Tisséo,"{""locality"": [{""id"": ""79"", ""name"": ""TOULO
SA_100,custom,Borde Haute,stop_area,,,31850,1.5314279793318943,43.64370947141033,"{""network"": ""Tisséo"", ""physical_mode"": ""3""}",network:Tisséo,"{""locality"": [{""id"": ""51"", ""name"": ""MONTRABE"
SA_1000,custom,Phidias,stop_area,,,31000,1.374173329972152,43.580869083701046,"{""network"": ""Tisséo"", ""physical_mode"": ""3""}",network:Tisséo,"{""locality"": [{""id"": ""79"", ""name"": ""TOULOUSE""}]
SA_1002,custom,Amidonniers,stop_area,,,31000,1.4281847885171595,43.60631516569829,"{""network"": ""Tisséo"", ""physical_mode"": ""10, 3""}",network:Tisséo,"{""locality"": [{""id"": ""79"", ""name"": ""TOUL
SA_1004,custom,Lauragais,stop_area,,,31130,1.53423130511658,43.586655062927974,"{""network"": ""Tisséo"", ""physical_mode"": ""3""}",network:Tisséo,"{""locality"": [{""id"": ""63"", ""name"": ""QUINT-FONSE
SA_1007,custom,Mayer,stop_area,,,31000,1.3954042541911866,43.54397616546114,"{""network"": ""Tisséo"", ""physical_mode"": ""3""}",network:Tisséo,"{""locality"": [{""id"": ""79"", ""name"": ""TOULOUSE""}],
SA_1008,custom,Françoise Dolto,stop_area,,,31000,1.3781796945667264,43.55555972591757,"{""network"": ""Tisséo"", ""physical_mode"": ""3""}",network:Tisséo,"{""locality"": [{""id"": ""79"", ""name"": ""TOUL
SA_1009,custom,Secteur A,stop_area,,,31700,1.3309088208015807,43.640006650717964,"{""network"": ""Tisséo"", ""physical_mode"": ""9""}",network:Tisséo,"{""locality"": [{""id"": ""20"", ""name"": ""CORNEBARR
SA_1010,custom,Cimetière Villeneuve,stop_area,,,31270,1.3692281473639352,43.52470437081928,"{""network"": ""Tisséo"", ""physical_mode"": ""3""}",network:Tisséo,"{""locality"": [{""id"": ""85"", ""name"": "
SA_1011,custom,Bellefontaine,stop_area,,,31000,1.3995556944383656,43.56633323874598,"{""network"": ""Tisséo"", ""physical_mode"": ""1, 10""}",network:Tisséo,"{""locality"": [{""id"": ""79"", ""name"": ""TO

Additional context

Autocomplete and search requests are fine.
We investigated and found that isCoarseReverse.js and isOnlyNonAdminLayers.js are experiencing some issues.
The list of non-coarse layers is hardcoded. Addition of our stop_area layer to the hardcoded list solved the issue.

We are novices to Pelias projects and require assistance in resolving it effectively. What is the approach to solving it in a generic manner?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with controller/predicates/isCoarseReverse.js and controller/predicates/isOnlyNonAdminLayers.js, then reproduce the supplied reverse request using the custom stop_area layer. Compare the reverse predicate behavior with the working autocomplete and search requests. Done means custom layers work with reverse layer filters without adding each layer to a hardcoded list.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.