OpenStreetMap find - A simple command line tool to explore osm data

A small tool for playing around with osm databases (those resulting from osm2pgsql). Read SETUP_DATABASE.md to learn how to set up the required database.

Note that osm2pgsql by default does not put all available tags into the database and osmf only deals with this limited tag-set.

Installation

git clone [email protected]:codesoap/osmf.git
cd osmf
go install
# The binary is now at ~/go/bin/osmf.

If you don't want to install the go compiler, you can download binaries from the latest release page.

Basic Usage

$ # Find all entries within 50m of the center of Bremen, Germany:
$ osmf 53.076 8.807 50
table: planet_osm_polygon
distance_meters: 0
osm_id: -3133460
osm_link: https://www.openstreetmap.org/relation/3133460
boundary: political
name: Bremen I
ref: 54
way_area: 427011008.000000

table: planet_osm_polygon
distance_meters: 0
osm_id: -4496501
osm_link: https://www.openstreetmap.org/relation/4496501
access: green_sticker_germany
boundary: low_emission_zone
name: Umweltzone Bremen
way_area: 19706300.000000
...

$ # Use UNIX tools to compact the output:
$ osmf 53.076 8.807 50 | awk '/^$/ /^(distance|osm_link|name)/'
distance_meters: 0
osm_link: https://www.openstreetmap.org/relation/3133460
name: Bremen I

distance_meters: 0
osm_link: https://www.openstreetmap.org/relation/4496501
name: Umweltzone Bremen
...

$ # Find a bicycle shop near the center of Bremen:
$ osmf 53.076 8.807 500 shop=bicycle | awk '/^(table|osm_id):/ {next} //'
distance_meters: 244
osm_link: https://www.openstreetmap.org/node/834082330
addr:housenumber: 30-32
name: Velo-Sport
operator: Velo-Sport Ihr Radsporthaus GmbH
shop: bicycle

More Examples

# Find a natural forest of at least 1km²:
osmf 53.076 8.807 3300 natural=wood 'way_area>1e+6'

# Find a bakery:
osmf 53.076 8.807 200 shop=bakery

# Find nearby public transport stations:
osmf 53.076 8.807 200 public_transport=stop_position

# Find nearby hiking routes:
osmf 53.076 8.807 500 route=hiking

# Searching for multiple values of the same tag is also possible:
osmf 53.076 8.807 3000 sport=climbing sport=swimming

# Pro tip: Use "_" to search for any value:
osmf 53.076 8.807 500 sport=_

# Learn about the population of the city and it's urban districts:
osmf 53.076 8.807 10000 population=_

Full Usage Info

osmf <lat> <long> <radius_meter> [way_area<<value>] [way_area><value>] [<tag>=<value>]...

General tags:
- access
- addr:housename
- addr:housenumber
- addr:interpolation
- admin_level
- aerialway
- aeroway
- amenity
- area
- barrier
- bicycle
- brand
- bridge
- boundary
- building
- construction
- covered
- culvert
- cutting
- denomination
- disused
- embankment
- foot
- generator:source
- harbour
- highway
- historic
- horse
- intermittent
- junction
- landuse
- layer
- leisure
- lock
- man_made
- military
- motorcar
- name
- natural
- office
- oneway
- operator
- place
- population
- power
- power_source
- public_transport
- railway
- ref
- religion
- route
- service
- shop
- sport
- surface
- toll
- tourism
- tower:type
- tunnel
- water
- waterway
- wetland
- width
- wood

Tags only for lines and polygons:
- tracktype

Tags only for for points:
- capital
- ele

The tags are explained here.

Owner
Similar Resources

Command line tool for processing client transaction data in CSV format

command line tool for processing client transaction data in CSV format. thank you for looking! build instructions: $ git clone https://github.com/lnit

Oct 29, 2021

traindown-cli is a command line tool for fitness data using the Traindrain specification.

traindown-cli traindown-cli is a command line tool for fitness data using Traindown. Installation go install github.com/OliverCardoza/traindown-cli@la

Mar 13, 2022

fofax is a fofa query tool written in go, positioned as a command-line tool and characterized by simplicity and speed.

fofax is a fofa query tool written in go, positioned as a command-line tool and characterized by simplicity and speed.

fofaX 0x00 Introduction fofax is a fofa query tool written in go, positioned as

Jan 8, 2023

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs ╭┈╯. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Jan 8, 2023

A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

Fake-SMS A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a pr

Dec 31, 2022

A very simple command line tool for downloading YouTube videos.

GoTube Overview This repository contains a single-file implementation of YouTube video downloader written in Go. It does not require any third-party p

Dec 20, 2022

GoTTY is a simple command line tool that turns your CLI tools into web applications.

GoTTY is a simple command line tool that turns your CLI tools into web applications.

GoTTY - Share your terminal as a web application

Jan 3, 2023

Simple command line tool to control TP-Link HS100 and HS110 Devices

tplink-hs1x-cli A simple app to control TPLink HS100 and HS110 devices. Sometimes it is just easier to use a simple cli tool to turn the lights on and

Nov 9, 2021

Simple, visual command line tool for redis

Simple, visual command line tool for redis

redis-cui Simple, visual command line tool for redis. Feature Simple and visual Server friendly Supported vim keys Same arguments as redis-cli Install

Sep 17, 2022
Comments
  • Help me find a better name

    Help me find a better name

    I have been told repeatedly that osmf is an unfortunate choice of name, because OSMF is used in the community to refer to the OSM Foundation. I should thus probably rename the tool. Who's got some ideas or opinions on a better name?

    Here are some ideas I already discarded:

    • osmq (q for query; already taken)
    • osmfind (a little too long for my taste)

    Here are some more ideas:

    • osmr (maybe a bit too generic)
    • osmfd
    • scout
    • spotter
    • gleanr
    • descry
    • espy
    • loc8
    • ambit
  • Handy tool!

    Handy tool!

    Thanks for open sourcing osmf, I played around with it using South Holland pbf from Geofabrik and it worked well for me. Do I understand correctly that you are not planning to extend it any further (text from release notes).

  • Supporting * in tag value search

    Supporting * in tag value search

    Lets say I want to retrieve all maxspeed tags regardless of their value. If I pass osmf lat long maxspeed I will get Could not parse filters: tag without value: maxspeed passing maxspeed=* is currently allowed but is not handled (osmf returns nothing).

    How about implementing explicit support for * to allow retrieving many different tags in one go? like in case of max speed.

  • Parametrizing db creds (host, user and pwd)

    Parametrizing db creds (host, user and pwd)

    Usecase: Accessing database other than localhost/gis with nopwd

    Proposed design:

    • read from env vars
    • read host and username from cmd params and the prompt for pwd if you can tell me which one you prefer (or if you see the need for this feature at all) I will make a PR
Oslatlong - CLI to query OSM Nominatim API

oslatlong Quickly conceived app to query OSM's Nominatim geocoding API. How do I

Jul 21, 2022
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

Nov 22, 2021
An open-source GitLab command line tool bringing GitLab's cool features to your command line
An open-source GitLab command line tool bringing GitLab's cool features to your command line

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching

Dec 30, 2022
A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purpose—to prompt for a value to be included in another command line. readval prints

Dec 22, 2021
Hasura-fzf - This command has a fzf-like UI that allows you to find and run the file version used by the hasura command

hasura-fzf This command has a fzf-like UI that allows you to find and run the fi

Sep 29, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Dec 31, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Feb 5, 2022
A command line tool for simplified docker volume command built with go

dockervol A command line tool for simplified docker volume command built with go. Features: Remove anonymous volume (beta) Remove volume by matching n

Dec 18, 2021
Package command provide simple API to create modern command-line interface

Package command Package command provide simple API to create modern command-line interface, mainly for lightweight usage, inspired by cobra Usage pack

Jan 16, 2022
Watcher - A simple command line app to watch files in a directory for changes and run a command when files change!

Watcher - Develop your programs easily Watcher watches all the files present in the directory it is run from of the directory that is specified while

Mar 27, 2022