I like searching for POIs via a query language on Overpass. My queries tend to be quite simple - “get all amenities of x type, in y area that have z tag”. The rendered map showing matching POIs is a nice-to-have, but not completely necessary.
What is the best way to do this offline, on Linux? (ideally using software already packaged for Debian, but that’s not vital).
I’m imagining a REPL that I can pass a downloaded map to, and then can query and see the results (in an ideal world, rendering them too).
It seems database schemas are close to what I want, but they seem to be designed more for people doing large scale complex queries and building bespoke databases just with the information they want.
Are these tools a good fit for my use case, or is there is a better/simpler way?
I wish there was a way to subscribe to post comments on lemmy - I was looking for something like this myself.
I can fake it by sending you a message if anything good comes up :)
not sure about lemmy but there is a bell icon in piefed that I think subscribes to posts. I mention because its easy to miss.
I am using the “favourite/save” function similar to this. I do not get noifications but I can go through my saves every now and then.
How big are the “downloaded maps”?
JOSM can do fairly complex queries with its search feature, maybe that satisfies your needs; but if you’re dealing with very large areas, they might overwhelm JOSM and not load in it.
ETA: of course “downloaded maps”, if you mean .osm files, are just XML files, so it’s completely trivial to write simple scripts to search through them oneself
Thank you for the tips! I should have been more precise in my question. The downloaded maps are ~150MB, in PBF format (although I would have been happy to use any other standard format if needed). I went with
osmium tags-filterin the end, and it seems to be working well.
Can osmium-tool do what you want?
For example if I go here and export an
osmfile aspittsburg.osm: https://www.openstreetmap.org/export#map=18%2F40.440748%2F-79.999822Then I run
osmium tags-filter pittsburg.osm n/amenity=library -o out.osmI get an
out.osmwith a bunch of libraries in it:<?xml version='1.0' encoding='UTF-8'?> <osm version="0.6" generator="osmium/1.18.0"> <bounds minlat="40.438994" minlon="-80.003256" maxlat="40.442501" maxlon="-79.996389"/> <node id="367964200" version="3" timestamp="2024-05-21T20:41:15Z" uid="3199858" user="Mateusz Konieczny - bot account" changeset="151646829" lat="40.4417942" lon="-79.9973275"> <tag k="addr:state" v="PA"/> <tag k="amenity" v="library"/> <tag k="ele" v="227"/> <tag k="gnis:feature_id" v="2429945"/> <tag k="name" v="Downtown and Business Branch Carnegie Free Library of Pittsburgh"/> <tag k="source" v="USGS Geonames"/> </node> <node id="367964584" version="4" timestamp="2024-05-21T20:41:32Z" uid="3199858" user="Mateusz Konieczny - bot account" changeset="151646829" lat="40.4397308" lon="-80.0008734"> <tag k="addr:state" v="PA"/> <tag k="amenity" v="library"/> <tag k="ele" v="223"/> <tag k="gnis:feature_id" v="2430651"/> <tag k="name" v="Point Park University Library"/> <tag k="source" v="USGS Geonames"/> </node> <node id="367964938" version="3" timestamp="2024-05-21T20:42:16Z" uid="3199858" user="Mateusz Konieczny - bot account" changeset="151646829" lat="40.4392024" lon="-79.9972654"> <tag k="addr:state" v="PA"/> <tag k="amenity" v="library"/> <tag k="ele" v="233"/> <tag k="gnis:feature_id" v="2430211"/> <tag k="name" v="Carnegie Library of Allegheny"/> <tag k="source" v="USGS Geonames"/> </node> <node id="2127151495" version="3" timestamp="2024-05-21T20:45:12Z" uid="3199858" user="Mateusz Konieczny - bot account" changeset="151646829" lat="40.4407273" lon="-79.9997963"> <tag k="addr:state" v="PA"/> <tag k="amenity" v="library"/> <tag k="ele" v="224"/> <tag k="gnis:feature_id" v="2430637"/> <tag k="name" v="Pittsburgh Downtown Branch Library"/> <tag k="source" v="USGS Geonames"/> </node> </osm>Thank you, this is perfect! Lightweight and easy to set up.
I could’t find anything with a quick search, but maybe you could run the API server in an application container (e.g. Docker)? 🤔
For more simple use cases, some apps on Flathub might be enough, for example Comaps
(Also, I haven’t used JOSM in a while, but it might be worth checking that out as well to see if it can do want you want)
Thank you. Of those I think JOSM is the most appealing, if it can directly show the results on the map. I’ll give it a go later just out of interest.
I also gave
osmium tags-filtera go and it’s meeting my needs for now.


