NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi, i have a question about overpass results. Im looking for pois with the following query

amenity=marketplace OR bar OR biergarten OR cafe OR "fast food" OR "food court" OR pub OR restaurant OR shop=alcohol OR bakery OR butcher OR cheese OR chocolate OR coffee OR deli OR farm OR greengrocer OR organic OR pasta OR patisserie OR pizza OR tea OR supermarket OR pizza OR craft=brewery OR caterer OR winery OR distillery

for Seattle i get these results https://monosnap.com/file/l5fDAzCZ7XBNXEPBABB6pr9cQmuIHx for each city i try, the number of pois are more or less the half of the number of nodes, always. Also if i export as kml and convert it to csv i will have only the half of the locations (so, only pois). I scraped yelp, tripadvisor and gmaps for several cities (with other tools) and im sure the results are close to the number of nodes on overpass (not to the number of pois). Check this https://monosnap.com/file/El6H9xwIqHdcAbPrU27SYHjhamug3H how can i extract all the nodes? thanks!

asked 22 Jun '21, 11:02

eldoland's gravatar image

eldoland
11334
accept rate: 0%

edited 22 Jun '21, 18:08

2

Can't do much to help without the full routine. Post a link.

(22 Jun '21, 14:14) DaveF

oh ok! here we go https://overpass-turbo.eu/s/18Hu

thanks!

(22 Jun '21, 18:01) eldoland

Hi Dave, thanks for your reply ok, try this query

amenity=marketplace OR bar OR biergarten OR cafe OR "fast food" OR "food court" OR pub OR restaurant OR shop=alcohol OR bakery OR butcher OR cheese OR chocolate OR coffee OR deli OR farm OR greengrocer OR organic OR pasta OR patisserie OR pizza OR tea OR supermarket OR pizza OR craft=brewery OR caterer OR winery OR distillery in Seattle

through the wizard i got this https://monosnap.com/file/l5fDAzCZ7XBNXEPBABB6pr9cQmuIHx if you export the pois, you will get 2k something results but the nodes are twice as much as the pois

I scraped Seattle on yelp and tripadvisor with webscraper.io and i got 5928 results. So i guess the number of nodes is more accurate than the number of pois. My question is, how can i get the nodes instead of pois? thanks!

permanent link

answered 22 Jun '21, 17:34

eldoland's gravatar image

eldoland
11334
accept rate: 0%

edited 22 Jun '21, 17:34

It's much easier to help you if you post a link using the 'share' button on the Turbo webpage.

(22 Jun '21, 17:59) DaveF

For each POI type, your Overpass query is searching for nodes, ways, and relations.

  • A POI mapped as node will return one node.
  • A POI mapped as a four-sided way like a rectangle will return four nodes, one for each corner.
  • A POI mapped as a more complex polygon, or as a relation, may return many nodes.

So the node total that Overpass returns is the number of nodes used to draw all of these things on the map. If even one result is a way or relation, then the total number of nodes will be greater than the total number of POIs.

If you search for only POIs mapped as nodes, the node total will be the same as the POI total. See this search (which is just your search with the ways and relations commented out): https://overpass-turbo.eu/s/18HA

See the OSM wiki for more detailed information about the data elements: https://wiki.openstreetmap.org/wiki/Elements

permanent link
This answer is marked "community wiki".

answered 22 Jun '21, 18:29

jmapb's gravatar image

jmapb
3.4k73361
accept rate: 22%

edited 22 Jun '21, 18:43

Hi, thanks for clarifying! so that means that actually osm is missing many pois. I got many more results scraping other resources (yelp, tripadvisor and gmaps). Do you agree? thanks!

(22 Jun '21, 18:53) eldoland

OK. Lots of variables here. First off, don't assume OSM (or other databases) are 100% accurate. Wizard isn't really that detailed. It takes a few, wild guesses For instance your "chocolate" & "coffee" returns vending machine & farm returns beehive! It also searches for both pizza & pasta using cuisine=italian. I /think/ you need to contain the or operators within brackets. It easier to learn to write your own routines IMO. Use the OSM wiki to find the more accurate tags to search for. https://wiki.openstreetmap.org/wiki/Main_Page

This is the condensed routine: https://overpass-turbo.eu/s/18HF

{{geocodeArea:Seattle}}->.Seattle;
(
    nwr[amenity~"^(marketplace|bar|biergarten|cafe|fast_food|food_court|pub|restaurant)$"](area.Seattle);
    nwr[shop~"^(alcohol|bakery|butcher|dairy|deli|greengrocer|pastry|supermarket)$"](area.Seattle);
  nwr[amenity=vending_machine][vending~"^(ice_cream|coffee)$"](area.Seattle);
    nwr[man_made=beehive](area.Seattle);

  nwr[amenity=recycling][recycling_type=container]["recycling:green_waste"=yes](area.Seattle);
  nwr[amenity=restaurant][cuisine=italian](area.Seattle);

  nwr[craft~"^(brewery|caterer]|winery|distillery)$"](area.Seattle);
);
out center;

Use nwr instead of node,way,relation

Use | as a replacement for 'or'

Use RegEx ~"^ and )$" to ensure only those individual words are searched for.

Use out center to return all data as POIs

permanent link

answered 22 Jun '21, 19:19

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

Hi DaveF thanks again for your reply! yes totally agree there is no 100% accurate database, that's why i scrape different sources and then i merge them all together. Thanks for the code, will try it and play around with tags!

(23 Jun '21, 12:59) eldoland

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×205
×13

question asked: 22 Jun '21, 11:02

question was seen: 1,923 times

last updated: 23 Jun '21, 12:59

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum