edit: I meant overpass not nominatum Hi there, I have a map where I show small locations. In order to do so I send a query to Overpass-api (for example 'amenity=supermarket') , then when it gets back I filter out all the big brand names (from a local hand typed array) and display the result on the map. To save time and data usage on both sides it would be great to filter the results on the overpass side before returning the result. For example 'if name and type has more then 10 locations in country x then remove from result'. My question: is this even possible? p.s. I know of a 'corporate' or 'chain' tag for shops, but it doesn's seem to be spread much so that's not of use, yet. asked 15 Apr '19, 15:48 tijmenheid |
You can use a query like this one. The parameter for the number of equal named objects is in line 4. Whether it makes sense if a different question. Note that there are many supermarkets with spelling variants in their name, keeping the less popular spelling variants intact. Or have combined names like "REWE Ihr Kaufpark", thus distinct from "REWE". answered 26 Apr '19, 19:01 Roland Olbricht Thanks Roland, the 'count' is indeed what I was looking for. (though the example doesn'T seem to work) For now the filtering I do with JS, and some tricks to filter out 'REWE Ihr Kaufpark' were a bit hard in the beginning but got it working now.
(02 May '19, 08:54)
tijmenheid
|
You are not saying what infrastructure you are using (your own instance of Nominatim or some public one) nor if you would be able to change that. But what you are trying to do seems to me to be better served by the Overpass API. With that you can search for keys (e. g. amenity=supermarket), look in specific areas, count results and add/subtract result sets. answered 15 Apr '19, 17:30 TZorn Oops you're right I meant OVerpass-api, just corrected it. Searches work fine, but do you know of a way to filter searches before returning them? (I mean like the example I posted, not the general ones)
(16 Apr '19, 12:12)
tijmenheid
2
I suggest you look at the language guide and the query examples linked to on the Overpass API page I quoted above. There you find examples of how to count and filter. If you still have issues post the query you are starting with here and someone can give you specific help (too advanced for myself).
(16 Apr '19, 13:58)
TZorn
Thanks for the suggestion TZorn, will take another look, maybe I'll find something to fix it with.
(17 Apr '19, 14:21)
tijmenheid
|