Crates.io | mapfilter |
lib.rs | mapfilter |
version | 0.1.0 |
source | src |
created_at | 2022-06-30 17:47:50.174493 |
updated_at | 2022-06-30 17:47:50.174493 |
description | CLI tool to run regex and location based filters on nodes from OpenStreetMap |
homepage | https://github.com/lacop/mapfilter |
repository | https://github.com/lacop/mapfilter |
max_upload_size | |
id | 616552 |
size | 42,043 |
CLI tool to run regex and location based filters on nodes from OpenStreetMap.
Download .osm.pbf
dump, for example from https://download.geofabrik.de/.
Run mapfilter map.osm.pbf <filters>
. Use mapfilter --help
for a full list of supported flags.
Show cities called "London":
$ mapfilter map.osm.pbf -n "^London$" -t "place=city"
โ London (#1)
โ ๐ http://openstreetmap.org/node/107775
โ ๐ http://google.com/maps/search/51.50732+-0.12765
โ ๐ท๏ธ capital: yes ele: 15 is_capital: country name: London
โ note: Centre of London officially at the former location of the Charing Cross, now the Charles I statue, near Trafalgar Square.
โ place: city population: 8908081 website: https://www.london.gov.uk/
โโโโโ
โ London (#2)
โ ๐ http://openstreetmap.org/node/65606
โ ๐ท๏ธ boundary: ceremonial designation: ceremonial_county int_name: London
โ name: London
โ note: This relation is for the 'county' of Greater London, which excludes the City of London
โ place: city type: boundary
โโโโโ
Total nodes: 188_243_033 / Filtered to: 2 / Displayed: 2
Show at most five towns, cities or villages that contain the same substring of 4+ characters twice:
$ mapfilter map.osm.pbf -m 5 -r "place=(city|town|village)" -f "^name\$=(?i)(....).*\1"
โ Loughborough (#1)
โ ๐ http://openstreetmap.org/node/10021975
โ ๐ http://google.com/maps/search/52.77239+-1.20780
โ ๐ท๏ธ is_in: Leicestershire, United Kingdom name: Loughborough place: town
โ population: 59317
โโโโโ
โ North Kilworth (#2)
โ ๐ http://openstreetmap.org/node/27150756
โ ๐ http://google.com/maps/search/52.44594+-1.09543
โ ๐ท๏ธ created_by: JOSM name: North Kilworth place: village
โโโโโ
โ Woolage Village (#3)
โ ๐ http://openstreetmap.org/node/29202181
โ ๐ http://google.com/maps/search/51.20597+1.19934
โ ๐ท๏ธ is_in: Kent, England, UK name: Woolage Village place: village
โ source: survey
โโโโโ
โ Auchtermuchty (#4)
โ ๐ http://openstreetmap.org/node/29622132
โ ๐ http://google.com/maps/search/56.29208+-3.23283
โ ๐ท๏ธ name: Auchtermuchty place: town population: 2093 source: npe
โโโโโ
โ Portree - Port Rรฌgh (#5)
โ ๐ http://openstreetmap.org/node/46628151
โ ๐ http://google.com/maps/search/57.41305+-6.19445
โ ๐ท๏ธ is_in: Isle of Skye, Highland Region name: Portree - Port Rรฌgh
โ place: town population: 2318
โโโโโ
โ Brightwell-cum-Sotwell (#6)
โ ๐ http://openstreetmap.org/node/266672299
โ ๐ http://google.com/maps/search/51.61551+-1.16521
โ ๐ท๏ธ created_by: Potlatch 0.10f name: Brightwell-cum-Sotwell place: village
โโโโโ
โ๏ธ Reached output limit, not showing more
Total nodes: 188_243_033 / Filtered to: 27 / Displayed: 5
Show places with population above 100k within 25km of a given point:
$ mapfilter map.osm.pbf -m 5 -r "population=\d{6}" -l "52.5,-1.5,25000"
โ Coventry (#1)
โ ๐ http://openstreetmap.org/node/17859918
โ ๐ http://google.com/maps/search/52.40818+-1.51048
โ ๐ 10_234 meters
โ ๐ท๏ธ is_in: West Midlands;England;UK name: Coventry place: city
โ population: 337428
โโโโโ
โ Solihull (#2)
โ ๐ http://openstreetmap.org/node/20980396
โ ๐ http://google.com/maps/search/52.41302+-1.77689
โ ๐ 21_108 meters
โ ๐ท๏ธ is_in: West Midlands name: Solihull place: town
โ population: 206091 source:population: council tax bill
โโโโโ
โ Hinckley (#3)
โ ๐ http://openstreetmap.org/node/26679131
โ ๐ http://google.com/maps/search/52.54106+-1.37294
โ ๐ 9_734 meters
โ ๐ท๏ธ name: Hinckley place: town population: 105078
โโโโโ
Total nodes: 188_243_033 / Filtered to: 3 / Displayed: 3
MIT