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

Overview

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.

You might also like...
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

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/[email protected]

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

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

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

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

GoTTY is a simple command line tool that turns your CLI tools into web applications.
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

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

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
    opened by codesoap 8
  • 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).

    opened by PiotrZakrzewski 2
  • 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.

    opened by PiotrZakrzewski 1
  • 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
    opened by PiotrZakrzewski 1
Releases(v2.1.0)
Owner
Richard Ulmer
Richard Ulmer
Oslatlong - CLI to query OSM Nominatim API

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

Omachonu Ogali 4 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

null 0 Nov 22, 2021
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

Clement Sam 2.1k Sep 22, 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

Venky 0 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

Shoki Hata 4 Jun 25, 2022
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

Gruntwork 644 Sep 6, 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. You give git-xargs:

Maxar Infrastructure 1 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

Moh Achun Armando 0 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

chenen 0 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

Geet Sethi 1 Mar 27, 2022