mapfilter

Crates.iomapfilter
lib.rsmapfilter
version0.1.0
sourcesrc
created_at2022-06-30 17:47:50.174493
updated_at2022-06-30 17:47:50.174493
descriptionCLI tool to run regex and location based filters on nodes from OpenStreetMap
homepagehttps://github.com/lacop/mapfilter
repositoryhttps://github.com/lacop/mapfilter
max_upload_size
id616552
size42,043
Laco Pรกpay (lacop)

documentation

README

Mapfilter

CLI tool to run regex and location based filters on nodes from OpenStreetMap.

Getting data

Download .osm.pbf dump, for example from https://download.geofabrik.de/.

Usage

Run mapfilter map.osm.pbf <filters>. Use mapfilter --help for a full list of supported flags.

Examples

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

License

MIT

Commit count: 16

cargo fmt