Skip to content

Instantly share code, notes, and snippets.

@michellemho
Last active October 6, 2023 09:14
Show Gist options
  • Save michellemho/37279122ecfcc854b770c882adf9abad to your computer and use it in GitHub Desktop.
Save michellemho/37279122ecfcc854b770c882adf9abad to your computer and use it in GitHub Desktop.
CartoCamp Overpass Tutorial

Around

From: http://wiki.openstreetmap.org/wiki/Overpass_API#Simple_usage_examples
around allows you to get all nodes near one or more given nodes. For example, to get all nodes that are at most 10 meters around the nodes called Bristol:

<query type="node">
  <has-kv k="name" v="Bristol"/>
</query>
<around radius="10"/>
<print/>

You can also chain queries to get only nodes satisfying a second criterion that are located near nodes matching the first criterion. Here, we will search for all bus stops within 100 meters of pubs named "Bristol":

<query type="node">
  <has-kv k="amenity" v="pub"/>
  <has-kv k="name" v="Bristol"/>
</query>
<query type="node">
  <around radius="100"/>
  <has-kv k="highway" v="bus_stop"/>
</query>
<print/>

Other examples

https://github.com/datadesk/overpass-turbo-turorial
http://osmlab.github.io/learnoverpass//en/

Overpass Turbo documentation: https://wiki.openstreetmap.org/wiki/Overpass_turbo/Wizard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment