Crates.io | what-osm-pbf |
lib.rs | what-osm-pbf |
version | 0.1.1 |
source | src |
created_at | 2024-09-05 21:18:37.226615 |
updated_at | 2024-09-06 07:31:10.389774 |
description | Get the necessary osm pbf files within a bounding box. |
homepage | http://jjcfrancis.co |
repository | https://github.com/jjcfrancisco/what-osm-pbf |
max_upload_size | |
id | 1365173 |
size | 75,964 |
Get the necessary osm.pbf
files within a bounding box.
cargo install what-osm-pbf
The levels represent the granularity of the areas that will be returned. The levels are as follows:
level=0
-> the most granular. It will find the smallest areas possible. In some countries such as England this is likely be at county level.level=1
-> likely to be regional areas within a country.level=2
-> likely to be the at country level.level=3
-> the least granular. Likely to be at continent level.Basic with level=2
wop --bbox=-7.382813,36.129002,-1.702881,38.410558 \
--level=2
# Output:
#
# ✅ Found 3 osm.pbf files that intersect
#
# Name: "Algeria", Link: "https://download.geofabrik.de/africa/algeria-latest.osm.pbf"
# Name: "Portugal", Link: "https://download.geofabrik.de/europe/portugal-latest.osm.pbf"
# Name: "Spain", Link: "https://download.geofabrik.de/europe/spain-latest.osm.pbf"
Save results to JSON using level=3
for least granular.
wop --bbox=-7.382813,36.129002,-1.702881,38.410558 \
--level=3 \
--savejson
# Output:
#
# ✅ Found 2 osm.pbf files that intersect
#
# Name: "Africa", Link: "https://download.geofabrik.de/africa-latest.osm.pbf"
# Name: "Europe", Link: "https://download.geofabrik.de/europe-latest.osm.pbf"
#
# 🎉 Results saved to what-osm-pbf.json
Download the results using level=0
for most granular.
wop --bbox=-7.382813,36.129002,-1.702881,38.410558 \
--level=0 \
--download
# Output:
#
# ✅ Found 6 osm.pbf files that intersect
#
# Name: "Algeria", Link: "https://download.geofabrik.de/africa/algeria-latest.osm.pbf"
# Name: "Portugal", Link: "https://download.geofabrik.de/europe/portugal-latest.osm.pbf"
# Name: "Andalucía", Link: "https://download.geofabrik.de/europe/spain/andalucia-latest.osm.pbf"
# Name: "Castilla-La Mancha", Link: "https://download.geofabrik.de/europe/spain/castilla-la-mancha-latest.osm.pbf"
# Name: "Extremadura", Link: "https://download.geofabrik.de/europe/spain/extremadura-latest.osm.pbf"
# Name: "Murcia", Link: "https://download.geofabrik.de/europe/spain/murcia-latest.osm.pbf"
#
# Downloading: "https://download.geofabrik.de/africa/algeria-latest.osm.pbf"
# ✓ Downloaded: "/Users/frankjimenez/repositories/what-osm-pbf/target/release/algeria-latest.osm.pbf"
#
# Downloading: "https://download.geofabrik.de/europe/portugal-latest.osm.pbf"
# ✓ Downloaded: "/Users/frankjimenez/repositories/what-osm-pbf/target/release/portugal-latest.osm.pbf"
#
# Downloading: "https://download.geofabrik.de/europe/spain/andalucia-latest.osm.pbf"
# ✓ Downloaded: "/Users/frankjimenez/repositories/what-osm-pbf/target/release/andalucia-latest.osm.pbf"
#
# Downloading: "https://download.geofabrik.de/europe/spain/castilla-la-mancha-latest.osm.pbf"
# ✓ Downloaded: "/Users/frankjimenez/repositories/what-osm-pbf/target/release/castilla-la-mancha-latest.osm.pbf"
#
# Downloading: "https://download.geofabrik.de/europe/spain/extremadura-latest.osm.pbf"
# ✓ Downloaded: "/Users/frankjimenez/repositories/what-osm-pbf/target/release/extremadura-latest.osm.pbf"
#
# Downloading: "https://download.geofabrik.de/europe/spain/murcia-latest.osm.pbf"
# ✓ Downloaded: "/Users/frankjimenez/repositories/what-osm-pbf/target/release/murcia-latest.osm.pbf"
See LICENSE