#openstreetmap #gis #maps

bin+lib overpass

Query OpenStreetMap Nodes

1 unstable release

0.1.0 Mar 28, 2024

#90 in Geospatial

Download history 141/week @ 2024-03-23 36/week @ 2024-03-30 6/week @ 2024-04-06

183 downloads per month

MIT license

14KB
169 lines

overpass-rs

Query OpenStreetMap nodes by attribute

Use with absolute caution. Querying OSM can hog down an Overpass server easily. I am not responsible for any damage this tool may cause.

Usage

This tool is available on crates.io and can be installed via cargo install overpass. It features a helpful CLI you can access via -h / --help.

It is also available as a library.

CLI Example

overpass\
  --url=https://overpass-api.de/api/interpreter \
  --key=amenity \
  --val=cafe bbox \
  --xmin=51.305219521963295 \
  --ymin=-0.7690429687500001 \
  --xmax=51.82219818336938 \
  --ymax=0.5273437500000064

Library Example

use overpass::{BoundingBox, Config};
use tokio;

#[tokio::main]
async fn main() {
 let c: Config = Config {
     url: "https://overpass-api.de/api/interpreter",
     timeout: 25,
     key: "amenity",
     val: "cafe",
 };

 let b: BoundingBox = BoundingBox {
     x_min: 51.305219521963295,
     y_min: -0.7690429687500001,
     x_max: 51.82219818336938,
     y_max: 0.5273437500000064,
 };

 let resp = b.search(&c).await.expect("failed query");

Dependencies

~7–19MB
~271K SLoC