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?

  • MoonMelon@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    4 days ago

    Can osmium-tool do what you want?

    For example if I go here and export an osm file as pittsburg.osm: https://www.openstreetmap.org/export#map=18%2F40.440748%2F-79.999822

    Then I run osmium tags-filter pittsburg.osm n/amenity=library -o out.osm

    I get an out.osm with 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>