|
1 |
| -[](https://github.com/interline-io/osm-planet-update/releases) |
2 |
| -[](https://hub.docker.com/r/interline/osm-planet-update/) |
| 1 | +[](https://github.com/interline-io/planetutils/releases) |
| 2 | +[](https://hub.docker.com/r/interline/planetutils/) |
| 3 | +[](https://circleci.com/gh/interline-io/planetutils) |
3 | 4 |
|
4 |
| -# OSM Planet Update Tools |
| 5 | +# Interline PlanetUtils |
5 | 6 |
|
6 |
| -Scripts and a Docker container to maintain your own mirror of the [OpenStreetMap](http://www.openstreetmap.org) planet. |
| 7 | +<!-- the following is generated by: |
| 8 | + 1. npm install --save markdown-toc -g |
| 9 | + 2. markdown-toc -i README.md |
| 10 | +--> |
| 11 | + |
| 12 | +<!-- toc --> |
| 13 | + |
| 14 | +- [Features](#features) |
| 15 | +- [Installation](#installation) |
| 16 | + * [Using Docker container](#using-docker-container) |
| 17 | + * [Using Homebrew on Mac OS](#using-homebrew-on-mac-os) |
| 18 | + * [Using Python package](#using-python-package) |
| 19 | +- [Usage](#usage) |
| 20 | + * [osm_planet_update](#osm_planet_update) |
| 21 | + * [osm_planet_extract](#osm_planet_extract) |
| 22 | + * [elevation_tile_download](#elevation_tile_download) |
| 23 | + * [Bounding box CSV file format](#bounding-box-csv-file-format) |
| 24 | +- [Support](#support) |
| 25 | + |
| 26 | +<!-- tocstop --> |
| 27 | + |
| 28 | +## Features |
| 29 | + |
| 30 | +Python-based scripts and a Docker container to work with planet-scale geographic data. Using PlanetUtils, you can: |
| 31 | + |
| 32 | +- maintain your own copy of the [OpenStreetMap](http://www.openstreetmap.org) planet (by applying incremental updates) |
| 33 | +- cut your copy of the OSM planet into named bounding boxes (a.k.a., mini Mapzen Metro Extracts) |
| 34 | +- download [Mapzen Terrain Tiles from AWS](https://aws.amazon.com/public-datasets/terrain/) for the planet or your bounding boxes |
| 35 | + |
| 36 | +PlanetUtils is packaged for use as a: |
| 37 | + |
| 38 | +- Docker container, for use on any operating system |
| 39 | +- Python package, for use on any operating system |
| 40 | +- Homebrew formula, for use on Mac OS |
| 41 | + |
| 42 | +## Installation |
| 43 | + |
| 44 | +### Using Docker container |
| 45 | + |
| 46 | +Make sure you have [Docker](https://www.docker.com/community-edition) installed. Then: |
| 47 | + |
| 48 | +```sh |
| 49 | +docker pull interline/planetutils:release-v0.2.0 |
| 50 | +``` |
| 51 | + |
| 52 | +### Using Homebrew on Mac OS |
| 53 | + |
| 54 | +Make sure you have [Homebrew](https://brew.sh/) installed. Then: |
| 55 | + |
| 56 | +```sh |
| 57 | +brew install interline-io/planetutils/planetutils |
| 58 | +``` |
| 59 | + |
| 60 | +### Using Python package |
| 61 | + |
| 62 | +If you want to install and use the Python package directly, you'll need to provide: |
| 63 | + |
| 64 | +- Python 2.x |
| 65 | +- Java |
| 66 | +- [Osmosis](https://wiki.openstreetmap.org/wiki/Osmosis) |
| 67 | +- [OSM C tools](https://gitlab.com/osm-c-tools/osmctools/) |
| 68 | + |
| 69 | +Then clone this repo, run the tests, and install the Python package: |
| 70 | + |
| 71 | +```sh |
| 72 | +git clone https://github.com/interline-io/planetutils.git |
| 73 | +nosetests |
| 74 | +pip install . |
| 75 | +``` |
7 | 76 |
|
8 | 77 | ## Usage
|
9 | 78 |
|
10 |
| -Using [Osmosis](https://wiki.openstreetmap.org/wiki/Osmosis): |
| 79 | +PlanetUtils supplies the following command-line utilities: |
| 80 | + |
| 81 | +### osm_planet_update |
| 82 | + |
| 83 | +Update a local OSM planet. For example: |
| 84 | + |
| 85 | +- Using Docker: |
| 86 | + ```sh |
| 87 | + docker run --rm -v ${PWD}/data:/data -t interline/planetutils:release-v0.2.0 osm_planet_update planet-latest.osm.pbf planet-new.osm.pbf |
| 88 | + ```` |
| 89 | +- Using Homebrew or Python: |
| 90 | + ```sh |
| 91 | + osm_planet_update planet-latest.osm.pbf planet-new.osm.pbf |
| 92 | + ``` |
| 93 | + |
| 94 | +If `planet-latest.osm.pbf` does not exist, it will be downloaded, before applying updates. |
| 95 | + |
| 96 | +By default, files are downloaded from planet.openstreetmap.org. Amazon Web Services also provides OSM planets through its Public Datasets program. To instead download the planet from AWS: |
| 97 | + |
| 98 | +1. Make sure you have your [AWS credentials configured locally](http://boto3.readthedocs.io/en/latest/guide/configuration.html). |
| 99 | +2. Append the `--s3` flag. |
| 100 | + |
| 101 | +Note that an entire OSM planet may be upwards of 40Gb in size! |
| 102 | + |
| 103 | +For complete help on command-line arguments: |
11 | 104 |
|
12 | 105 | ```sh
|
13 |
| -mkdir -p data |
14 |
| -docker run --rm -v data:/data -t interline/osm-planet-update:release-v0.1.1 |
| 106 | +osm_planet_update -h |
15 | 107 | ```
|
| 108 | + |
| 109 | +### osm_planet_extract |
| 110 | + |
| 111 | +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!) |
| 112 | + |
| 113 | +To create a single extract: |
| 114 | + |
| 115 | +- Using Docker: |
| 116 | + ```sh |
| 117 | + docker run --rm -v ${PWD}/data:/data -t interline/planetutils:release-v0.2.0 osm_planet_extract /data/osm_extracts --bbox=-122.737,37.449,-122.011,37.955 --name=san-francisco |
| 118 | + ```` |
| 119 | +- Using Homebrew or Python: |
| 120 | + ```sh |
| 121 | + osm_planet_extract data/osm_extracts --bbox=-122.737,37.449,-122.011,37.955 --name=san-francisco |
| 122 | + ``` |
| 123 | + |
| 124 | +To specify more than one bounding box of tiles to download, list the bounding boxes in a [CSV file](#bounding-box). For example: |
| 125 | + |
| 126 | +- Using Docker: |
| 127 | + ```sh |
| 128 | + docker run --rm -v ${PWD}/data:/data -t interline/planetutils:release-v0.2.0 osm_planet_extract /data/osm_extracts --csv=/data/bboxes.csv |
| 129 | + ```` |
| 130 | +- Using Homebrew or Python: |
| 131 | + ```sh |
| 132 | + osm_planet_extract data/osm_extracts --csv=data/bboxes.csv |
| 133 | + ``` |
| 134 | +
|
| 135 | +For complete help on command-line arguments: |
| 136 | +
|
| 137 | +```sh |
| 138 | +osm_planet_extract -h |
| 139 | +``` |
| 140 | +
|
| 141 | +### elevation_tile_download |
| 142 | +
|
| 143 | +Download elevation tiles from the [Terrain Tiles in the AWS Public Datasets program](https://aws.amazon.com/public-datasets/terrain/). Download for the entire planet, only tiles within a single bounding box, or within multiple bounding boxes. |
| 144 | +
|
| 145 | +To download the entire planet of tiles (__which will require about 1.6Tb of space!__): |
| 146 | +
|
| 147 | +- Using Docker: |
| 148 | + ```sh |
| 149 | + docker run --rm -v ${PWD}/data:/data -t interline/planetutils:release-v0.2.0 elevation_tile_download /data/elevation |
| 150 | + ```` |
| 151 | +- Using Homebrew or Python: |
| 152 | + ```sh |
| 153 | + elevation_tile_download data/elevation |
| 154 | + ``` |
| 155 | + |
| 156 | +To download tiles to cover a single bounding box: |
| 157 | + |
| 158 | +- Using Docker: |
| 159 | + ```sh |
| 160 | + docker run --rm -v ${PWD}/data:/data -t interline/planetutils:release-v0.2.0 elevation_tile_download /data/elevation --bbox=-122.737,37.449,-122.011,37.955 |
| 161 | + ```` |
| 162 | +- Using Homebrew or Python: |
| 163 | + ```sh |
| 164 | + elevation_tile_download data/elevation --bbox=-122.737,37.449,-122.011,37.955 |
| 165 | + ``` |
| 166 | +
|
| 167 | +To specify more than one bounding box of tiles to download, list the bounding boxes in a [CSV file](#bounding-box). For example: |
| 168 | +
|
| 169 | +- Using Docker: |
| 170 | + ```sh |
| 171 | + docker run --rm -v ${PWD}/data:/data -t interline/planetutils:release-v0.2.0 elevation_tile_download /data/elevation --csv=/data/bboxes.csv |
| 172 | + ```` |
| 173 | +- Using Homebrew or Python: |
| 174 | + ```sh |
| 175 | + elevation_tile_download data/elevation --csv=data/bboxes.csv |
| 176 | + ``` |
| 177 | +
|
| 178 | +For complete help on command-line arguments: |
| 179 | +
|
| 180 | +```sh |
| 181 | +elevation_tile_download -h |
| 182 | +``` |
| 183 | +
|
| 184 | +### Bounding box CSV file format |
| 185 | +<a name="bounding-box"></a> |
| 186 | +
|
| 187 | +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 CSV file. Do not include a header row. The format is as follows: |
| 188 | +
|
| 189 | +```csv |
| 190 | +[name for extract],[left longitude],[bottom latitude],[right longitude],[top latitude] |
| 191 | +``` |
| 192 | +
|
| 193 | +For example: |
| 194 | +```csv |
| 195 | +san-francisco,-122.737,37.449,-122.011,37.955 |
| 196 | +dar-es-salaam,38.894,-7.120,39.661,-6.502 |
| 197 | +``` |
| 198 | +
|
| 199 | +To determine a bounding box, try the tool at http://bboxfinder.com/ |
| 200 | +
|
| 201 | +## Support |
| 202 | +
|
| 203 | +To report a bug, please [open an issue](https://github.com/interline-io/planetutils). |
| 204 | +
|
| 205 | +Interline Technologies also provides professional support and consulting services around this and other related tools. Contact us at info@interline.io for more information. |
0 commit comments