addok icon indicating copy to clipboard operation
addok copied to clipboard

Question: is there an API to query the filters used by and instance of addok ?

Open pyrog opened this issue 5 years ago • 4 comments

The query https://demo.addok.xyz/search/?q=gare à annecy return features with properties poi=bus_stop, poi=station or poi=platform.

https://demo.addok.xyz/search/?q=défibrillateur à marseille return features with property poi=defibrillator.

I guess that poi is a filter of the demo.addok.xyz instance.

Questions

  • How to get the list of all filters ?
  • How to get the list of all values for this filter ?
  • How to filter the search to get only poi=station ?

pyrog avatar Aug 14 '20 07:08 pyrog

How to filter the search to get only poi=station ?

According https://github.com/addok/addok/issues/608#issuecomment-587545686 we could search for poi only: https://demo.addok.xyz/search/?q=annecy&type=poi Or filter the search to return city only: https://demo.addok.xyz/search/?q=annecy&type=city

{
  "attribution": "BANO+OSM POI", 
  "features": [
    {
      "geometry": {
        "coordinates": [
          6.128885, 
          45.899235
        ], 
        "type": "Point"
      }, 
      "properties": {
        "adm_weight": 4, 
        "city": "Annecy", 
        "departement": "Haute-Savoie", 
        "id": "74010", 
        "importance": 0.756, 
        "label": "Annecy", 
        "name": "Annecy", 
        "population": 126924, 
        "postcode": "74000", 
        "region": "Auvergne-Rh\u00f4ne-Alpes", 
        "score": 0.9778181818, 
        "type": "city"
      }, 
      "type": "Feature"
    }
  ], 
  "filters": {
    "type": "city"
  }, 
  "licence": "ODbL 1.0", 
  "limit": 5, 
  "query": "annecy", 
  "type": "FeatureCollection", 
  "version": "draft"
}

Note: the query return the list of filters used (here type=city)

But https://demo.addok.xyz/search/?q=annecy&type=poi&poi=bus_stop don't work poi is not a filter for this instance.

pyrog avatar Aug 14 '20 07:08 pyrog

POI data is generated by https://github.com/osm-fr/osmpoi4addok

It is then fed to addok in the standard way.

The types of POI taken into account are in the CVS file: https://github.com/osm-fr/osmpoi4addok/blob/master/def.csv

A filter exists on the type field, but none on the poi field itself. It could be added easily.

cquest avatar Aug 14 '20 08:08 cquest

I've just added a filter on the poi field on demo.addok.xyz, but you still have to provide some text in the query q field...

cquest avatar Aug 14 '20 09:08 cquest

https://demo.addok.xyz/search/?q=brest&poi=defibrillator&limit=100

Thank you 😃

pyrog avatar Aug 14 '20 09:08 pyrog