Skip to content

Commit

Permalink
v0.4.9 (with support for extracting polygons from OSM)
Browse files Browse the repository at this point in the history
  • Loading branch information
drewda committed Jul 3, 2019
1 parent 7692de5 commit e54244f
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

# Interline PlanetUtils

<!-- the following is generated by:
1. npm install --save markdown-toc -g
2. markdown-toc -i README.md
-->
<!-- the following is generated by: npx markdown-toc -i README.md -->

<!-- toc -->

Expand All @@ -25,9 +22,9 @@
* [elevation_tile_merge](#elevation_tile_merge)
* [valhalla_tilepack_list](#valhalla_tilepack_list)
* [valhalla_tilepack_download](#valhalla_tilepack_download)
- [Specifying bounding boxes](#specifying-bounding-boxes)
- [Specifying extract extents](#specifying-extract-extents)
* [Bounding box file: CSV format](#bounding-box-file-csv-format)
* [Bounding box file: GeoJSON format](#bounding-box-file-geojson-format)
* [Bounding box/polygon file: GeoJSON format](#bounding-boxpolygon-file-geojson-format)
- [Switching toolchains](#switching-toolchains)
- [Support](#support)

Expand Down Expand Up @@ -59,15 +56,15 @@ PlanetUtils is a "high level" library that makes use of [Osmosis](https://wiki.o
Make sure you have [Docker](https://www.docker.com/community-edition) installed. Then:

```sh
docker pull interline/planetutils:release-v0.4.8
docker pull interline/planetutils:release-v0.4.9
```

Any of the example commands below can be executed with `docker run`. It may be helpful to mount a local directory inside the container for persistence and to access output files.

- Example of using `docker run` with the `data` directory mounted as `/data`:

```sh
docker run --rm -v ${PWD}/data:/data -t interline/planetutils:release-v0.4.8 <command>
docker run --rm -v ${PWD}/data:/data -t interline/planetutils:release-v0.4.9 <command>
```

### Using Homebrew on Mac OS
Expand Down Expand Up @@ -124,15 +121,15 @@ osm_planet_update -h

### osm_planet_extract

Cut up an OSM planet file into one or more extracts, defined by bounding boxes. Each bounding box is assigned a name. (This is like a mini version of Mapzen Metro Extracts!)
Cut up an OSM planet file into one or more extracts, defined by bounding boxes or polygons. Each extract is assigned a name. (This is like a mini version of Mapzen Metro Extracts!)

To create a single extract:

```sh
osm_planet_extract --outpath=data/osm_extracts --bbox=-122.737,37.449,-122.011,37.955 --name=san-francisco planet-latest.osm.pbf
```

To specify more than one bounding box of tiles to download, list the bounding boxes in a [CSV file or GeoJSON file](#bounding-box). For example:
To specify more than one bounding box of tiles to download, list the extents in a [CSV file or GeoJSON file](#bounding-box). For example:

```sh
osm_planet_extract --outpath=data/osm_extracts --csv=data/bboxes.csv planet-latest.osm.pbf
Expand Down Expand Up @@ -268,10 +265,10 @@ For complete help on command-line arguments:
valhalla_tilepack_download -h
```

## Specifying bounding boxes
## Specifying extract extents
<a name="bounding-box"></a>

When extracting multiple bounding boxes from an OSM planet, or when downloading multiple bounding boxes of elevation tiles, you can specify your bounding boxes in a single file, either CSV or GeoJSON format.
When extracting multiple bounding boxes or polygons from an OSM planet, or when downloading multiple bounding boxes of elevation tiles, you can specify your extents in a single file, either CSV or GeoJSON format.

### Bounding box file: CSV format

Expand All @@ -289,15 +286,15 @@ dar-es-salaam,38.894,-7.120,39.661,-6.502

To determine a bounding box, try the tool at http://bboxfinder.com/

### Bounding box file: GeoJSON format
### Bounding box/polygon file: GeoJSON format

Alternatively, you can specify the bounding boxes as features in a GeoJSON file, using the `--geojson` argument.
Alternatively, you can specify the bounding boxes or polygons as features in a GeoJSON file, using the `--geojson` argument.

```sh
osm_planet_extract --geojson=examples/test.geojson examples/san-francisco-downtown.osm.pbf
```

To draw bounding box polygons in GeoJSON, try the tool at http://geojson.io/. Currently, the bounding box for each feature is used. Future releases may support polygon clipping.
To draw extents in GeoJSON, try the tool at http://geojson.io/

## Switching toolchains

Expand Down

0 comments on commit e54244f

Please sign in to comment.