2

I have been tasked with researching good locations for vending machines. I have positive factors such as:

  • School nearby
  • Bus Stop nearby
  • Gas station nearby

Then I have some negative factors like:

  • fast food joints
  • super markets

and others.

I am trying to find a systematic way of identifying good places.

What I really need is to display nodes, which are nearby each other but are not nearby my negative list.

So far I managed to display multiple types of nodes in overpass turbo with the following code:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“amenity=school”
*/
[out:json][timeout:25];
// gather results
(
  node["highway"="bus_stop"]({{bbox}});
  relation["amenity"="school"]({{bbox}});
  relation["industrial"="factory"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

https://overpass-turbo.eu/s/ZVJ

Bus Stops and Schools are shown, however, factories for some reason are not. How can I filter from here to, for example only show bus stops and school in close proximity to each other? How do I exclude nodes based on proximity to other nodes?

Are there any other useful methods I should look at to achieve my aim of finding the best places for vending machines? Is there a way to visualize traffic statistics (busy roads) on OSM?

1 Answer 1

1

Bus Stops and Schools are shown, however, factories for some reason are not.

Are there any other useful methods I should look at to achieve my aim of finding the best places for vending machines? Is there a way to visualize traffic statistics (busy roads) on OSM?

You are only searching on relation for factories. Some tags are used as nodes or ways. Here is the description of OSM tag data structures: https://wiki.openstreetmap.org/wiki/Elements

If you go to each of these tag pages, you'll see a link to overpass-turbo with all possibilities for that tag:

Here's an updated "full" query, which can be simplified when you find out what kind of objects are returned for each tag: https://overpass-turbo.eu/s/ZVz

[out:json][timeout:25];
// gather results
(
   // query part for: “highway=bus_stop”
  node["highway"="bus_stop"]({{bbox}});
  way["highway"="bus_stop"]({{bbox}});
  relation["highway"="bus_stop"]({{bbox}});

  // query part for: “amenity=school”
  node["amenity"="school"]({{bbox}});
  way["amenity"="school"]({{bbox}});
  relation["amenity"="school"]({{bbox}});

  // query part for: “industrial=factory”
  node["industrial"="factory"]({{bbox}});
  way["industrial"="factory"]({{bbox}});
  relation["industrial"="factory"]({{bbox}});

);
// print results
out body;
>;
out skel qt;

How can I filter from here to, for example only show bus stops and school in close proximity to each other?

Eventually you'll have to download bulk files and run osmconvert and osmfilter on them. Search this forum or others for steps for this process.

For distance between nodes, instead of actual "distance", you may want to use Routing: https://wiki.openstreetmap.org/wiki/Routing

How do I exclude nodes based on proximity to other nodes?

Probably this should be its own question, perhaps on https://gis.stackexchange.com

But once you have raw data locally, there are many tools to parse and filter, or write your own, which can use whatever distance/proximity metric you desire. In the end, all the nodes/ways/relations are series of latitude/longitude for which you can apply mathematical operations.

2
  • Is OSMfilter beginner friendly? I am having a hard time with overpass already. Nov 10, 2020 at 12:40
  • osmfilter is used to take bulk files and keep only a few tags. There are plenty of examples online, also in this forum. You can use osmconvert to write csv files, which might be more user-friendly than geo-data-formats: wiki.openstreetmap.org/wiki/Osmconvert#Writing_CSV_Files.
    – philshem
    Nov 10, 2020 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.