-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,24 +3,24 @@ 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. | ||
the database and osmar only deals with this limited tag-set. | ||
|
||
# Installation | ||
```bash | ||
git clone [email protected]:codesoap/osmf.git | ||
cd osmf | ||
git clone [email protected]:codesoap/osmar.git | ||
cd osmar | ||
go install | ||
# The binary is now at ~/go/bin/osmf. | ||
# The binary is now at ~/go/bin/osmar. | ||
``` | ||
|
||
If you don't want to install the go compiler, you can download binaries | ||
from the | ||
[latest release page](https://github.com/codesoap/osmf/releases/tag/v2.0.0). | ||
[latest release page](https://github.com/codesoap/osmar/releases/tag/v2.0.0). | ||
|
||
# Basic Usage | ||
```console | ||
$ # Find all entries within 50m of the center of Bremen, Germany: | ||
$ osmf 53.076 8.807 50 | ||
$ osmar 53.076 8.807 50 | ||
table: planet_osm_polygon | ||
distance_meters: 0 | ||
osm_id: -3133460 | ||
|
@@ -41,7 +41,7 @@ way_area: 19706300.000000 | |
... | ||
|
||
$ # Use UNIX tools to compact the output: | ||
$ osmf 53.076 8.807 50 | awk '/^$/ /^(distance|osm_link|name)/' | ||
$ osmar 53.076 8.807 50 | awk '/^$/ /^(distance|osm_link|name)/' | ||
distance_meters: 0 | ||
osm_link: https://www.openstreetmap.org/relation/3133460 | ||
name: Bremen I | ||
|
@@ -52,7 +52,7 @@ 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} //' | ||
$ osmar 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 | ||
|
@@ -64,42 +64,42 @@ shop: bicycle | |
# More Examples | ||
```bash | ||
# Find a natural forest of at least 1km²: | ||
osmf 53.076 8.807 3300 natural=wood 'way_area>1e+6' | ||
osmar 53.076 8.807 3300 natural=wood 'way_area>1e+6' | ||
|
||
# Find a bakery: | ||
osmf 53.076 8.807 200 shop=bakery | ||
osmar 53.076 8.807 200 shop=bakery | ||
|
||
# Find nearby public transport stations: | ||
osmf 53.076 8.807 200 public_transport=stop_position | ||
osmar 53.076 8.807 200 public_transport=stop_position | ||
|
||
# Find nearby hiking routes: | ||
osmf 53.076 8.807 500 route=hiking | ||
osmar 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 | ||
osmar 53.076 8.807 3000 sport=climbing sport=swimming | ||
|
||
# Pro tip: Use "_" to search for any value: | ||
osmf 53.076 8.807 500 sport=_ | ||
osmar 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=_ | ||
osmar 53.076 8.807 10000 population=_ | ||
``` | ||
|
||
# Custom Database Connection | ||
A custom database connection can be used by setting | ||
the `OSMF_CONN` environment variable; find more info | ||
the `OSMAR_CONN` environment variable; find more info | ||
[here](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING): | ||
|
||
```console | ||
OSMF_CONN='postgres://user:password@localhost:5432/gis' osmf 53.076 8.807 50 | ||
OSMAR_CONN='postgres://user:password@localhost:5432/gis' osmar 53.076 8.807 50 | ||
``` | ||
|
||
# Full Usage Info | ||
``` | ||
osmf <lat> <long> <radius_meter> [way_area<<value>] [way_area><value>] [<tag>=<value>]... | ||
osmar <lat> <long> <radius_meter> [way_area<<value>] [way_area><value>] [<tag>=<value>]... | ||
Environment: | ||
OSMF_CONN Custom connection string for the PostgreSQL database. | ||
OSMAR_CONN Custom connection string for the PostgreSQL database. | ||
General tags: | ||
access | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/codesoap/osmf | ||
module github.com/codesoap/osmar | ||
|
||
go 1.13 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters