All Projects → interline-io → Planetutils

interline-io / Planetutils

Licence: other
Scripts and a Docker container to maintain your own OpenStreetMap planet, terrain tiles, & Valhalla Tilepacks

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Planetutils

Offroad-routing-engine
Off-road Navigation System
Stars: ✭ 16 (-86.78%)
Mutual labels:  maps, openstreetmap
Mapbox Gl Native
Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
Stars: ✭ 4,091 (+3280.99%)
Mutual labels:  maps, openstreetmap
map-machine
Python renderer for OpenStreetMap with custom icons intended to display as many map features as possible
Stars: ✭ 82 (-32.23%)
Mutual labels:  maps, openstreetmap
mapus
A map tool with real-time collaboration 🗺️
Stars: ✭ 2,687 (+2120.66%)
Mutual labels:  maps, openstreetmap
Utymap
Highly customizable library for procedural world generation based on real map data
Stars: ✭ 825 (+581.82%)
Mutual labels:  maps, openstreetmap
o.map
Open Street Map app - KaiOS
Stars: ✭ 51 (-57.85%)
Mutual labels:  maps, openstreetmap
Vectiler
A vector tile, terrain and city 3d model builder and exporter
Stars: ✭ 394 (+225.62%)
Mutual labels:  terrain, openstreetmap
s60-maps
Yet another maps for Symbian OS
Stars: ✭ 27 (-77.69%)
Mutual labels:  maps, openstreetmap
Blender Osm
One click download and import of OpenStreetMap and terrain for Blender! Global coverage! Source code is in the branch 'release'.
Stars: ✭ 588 (+385.95%)
Mutual labels:  terrain, openstreetmap
Worldwindjava
The NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.
Stars: ✭ 526 (+334.71%)
Mutual labels:  terrain, maps
maps4cim
maps4cim - a real world map generator for CiM 2
Stars: ✭ 21 (-82.64%)
Mutual labels:  maps, openstreetmap
Openmaptiles
OpenMapTiles Vector Tile Schema Implementation
Stars: ✭ 1,175 (+871.07%)
Mutual labels:  maps, openstreetmap
organicmaps
🍃 Organic Maps is a free Android & iOS offline maps app for travelers, tourists, hikers, and cyclists. It uses crowd-sourced OpenStreetMap data and is developed with love by MapsWithMe (MapsMe) founders and our community. No ads, no tracking, no data collection, no crapware. Your donations and positive reviews motivate and inspire our small team!
Stars: ✭ 3,689 (+2948.76%)
Mutual labels:  maps, openstreetmap
bexhill-osm
A local mapping project using data from OpenStreetMap. Includes overlays, walking directions and historical information.
Stars: ✭ 16 (-86.78%)
Mutual labels:  maps, openstreetmap
osm-geojson
🔰 Get GeoJSON of a OpenStreetMap's relation from the API.
Stars: ✭ 42 (-65.29%)
Mutual labels:  maps, openstreetmap
Osmnx
OSMnx: Python for street networks. Retrieve, model, analyze, and visualize street networks and other spatial data from OpenStreetMap.
Stars: ✭ 3,357 (+2674.38%)
Mutual labels:  maps, openstreetmap
orange3-geo
🍊 🌍 Orange add-on for dealing with geography and geo-location
Stars: ✭ 22 (-81.82%)
Mutual labels:  maps, openstreetmap
Weltenschaft
Open-Source terrain generator 🗺️
Stars: ✭ 41 (-66.12%)
Mutual labels:  maps, terrain
Timezone Boundary Builder
A tool to extract data from Open Street Map (OSM) to build the boundaries of the world's timezones.
Stars: ✭ 469 (+287.6%)
Mutual labels:  maps, openstreetmap
Explorer
WorldWindExplorer: A 3D virtual globe geo-browser app framework based on WorldWindJS, Bootstrap and KnockoutJS. Includes 3D globe and 2D map projections, imagery, terrain, markers, plus solar and celestial data.
Stars: ✭ 59 (-51.24%)
Mutual labels:  terrain, maps

current release version Docker Hub container image build status CircleCI code test status

Interline PlanetUtils

Features

Python-based scripts and a Docker container to work with planet-scale geographic data. Using PlanetUtils, you can:

PlanetUtils is packaged for use as a:

  • Docker container, for use on any operating system
  • Python package, for use on any operating system
  • Homebrew formula, for use on Mac OS

PlanetUtils is a "high level" library that makes use of Osmosis, OSM C tools, and Osmium among other great open-source components.

Installation

Using Docker container

Make sure you have Docker installed. Then:

docker pull interline/planetutils:release-v0.4.11

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:
docker run --rm -v ${PWD}/data:/data -t interline/planetutils:release-v0.4.11 <command>

Using Homebrew on Mac OS

Make sure you have Homebrew installed. Then:

brew install interline-io/planetutils/planetutils

Using Python package

If you want to install and use the Python package directly, you'll need to provide:

Then clone this repo, run the tests, and install the Python package:

git clone https://github.com/interline-io/planetutils.git
python ./setup.py test
pip install .

Command-line Usage

PlanetUtils supplies the following command-line utilities:

osm_planet_update

Update a local OSM planet. For example:

osm_planet_update planet-recent.osm.pbf planet-with-updates.osm.pbf

If planet-recent.osm.pbf does not exist locally, the most recent planet file will be downloaded, before applying hourly updates to it. (Note: This download is nearly 40Gb.) 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 file from AWS:

  1. Make sure you have your AWS credentials configured locally.
  2. Append the --s3 flag.

Note that an entire OSM planet may be upwards of 40Gb in size! In other words, you should have ~80Gb free disk space before running this command.

For complete help on command-line arguments:

osm_planet_update -h

osm_planet_extract

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:

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 extents in a CSV file or GeoJSON file. For example:

osm_planet_extract --outpath=data/osm_extracts --csv=data/bboxes.csv planet-latest.osm.pbf

For complete help on command-line arguments:

osm_planet_extract -h

osm_extract_download

Download regularly updated OSM extracts for popular cities and regions from OSM Extracts by Interline. Browse available extracts using the web interface or the GeoJSON file. Anyone can browse the available extracts or propose changes to the extract bounding boxes on GitHub. A subscription is required to download extracts, to cover hosting costs and keep the service sustainable. (See the OSM Extracts website for more information on how profits are donated to OpenStreetMap and other "open" efforts.)

To download the latest copy of an extract (if abcd is your Interline API token and abidjan_ivory-coast is the ID for your chosen extract region):

osm_extract_download --api-token=abcd abidjan_ivory-coast

You can also download extracts in GeoJSON format by using --data-format=geojson. Warning: these can be very large files, but may be useful for filtering and displaying on a web map.

For complete help on command-line arguments:

osm_extract_download -h

(Note: OSM Extracts is a hosted and managed version of the PlanetUtils library. Every day, the pipeline runs the osm_planet_update and osm_planet_extract commands.)

osm_planet_get_timestamp

A simple utility to print the timestamp of an OpenStreetMap PBF file.

osm_planet_get_timestamp planet-latest.osm.pbf

elevation_tile_download

Download elevation tiles from the Terrain Tiles in the AWS Public Datasets program. Download for the entire planet, only tiles within a single bounding box, or within multiple bounding boxes.

Elevation tiles are available in a variety of formats. This command supports the download of:

  • GeoTIFF (default): extension .tif in Web Mercator projection, 512x512 tiles
  • Skadi: extension .hgt in unprojected latlng, 1°x1° tiles

To download the entire planet in Skadi tiles (which will require about 1.6Tb of space!):

elevation_tile_download --format=skadi --outpath=data/elevation

To download GeoTIFF tiles to cover a single bounding box at a specified zoom level:

elevation_tile_download --outpath=data/elevation --bbox=-122.737,37.449,-122.011,37.955 --zoom=10

To specify more than one bounding box of tiles to download, list the bounding boxes in a CSV file or GeoJSON file. For example:

elevation_tile_download --outpath=data/elevation --csv=data/bboxes.csv

For complete help on command-line arguments:

elevation_tile_download -h

elevation_tile_merge

After downloading elevation tiles using the elevation_tile_download command, use this command to merge together multiple tiles. You can optionally resample elevation values as part of the merge process.

This command only operates on GeoTIFF format elevation tiles.

Warnings: merging lots of tiles can be resource intensive!

To merge a directory of GeoTIFF files:

elevation_tile_merge single_tile.tif geo_tiff_tiles/

For complete help on command-line arguments:

elevation_tile_merge -h

valhalla_tilepack_list

Use Valhalla Tilepacks from Interline to power your own instances of the Valhalla routing engine. Anyone can list available planet tilepacks. A subscription and an API key are required to download tilepacks.

To list all available planet tilepacks:

valhalla_tilepack_list

For complete help on command-line arguments:

valhalla_tilepack_list -h

valhalla_tilepack_download

Download Valhalla Tilepacks from Interline to power your own instances of the Valhalla routing engine. A subscription and an API key are required to download tilepacks.

Initial set-up:

  1. Sign up for Valhalla Tilepacks from Interline.
  2. Set your API token as an environment variable (INTERLINE_API_TOKEN) or use it as an argument to the command

To download the latest planet tilepack (if abcd is your Interline API token):

valhalla_tilepack_download --api-token=abcd

or set your API token as an environment variable, and download the latest planet tilepack:

export INTERLINE_API_TOKEN=abcd
valhalla_tilepack_download

For complete help on command-line arguments:

valhalla_tilepack_download -h

Specifying extract extents

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

Do not include a header row. The format is as follows:

[name for extract],[left longitude],[bottom latitude],[right longitude],[top latitude]

For example:

san-francisco,-122.737,37.449,-122.011,37.955
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/polygon file: GeoJSON format

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

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

To draw extents in GeoJSON, try the tool at http://geojson.io/

Switching toolchains

PlanetUtils wraps up a number of libraries, including Osmosis, Osmium, and OSM C Tools. Some PlanetUtils commands allow you to switch which library is used to perform the operation:

PlanetUtils command argument flag default options
osm_planet_update --toolchain osmosis osmosis, osmium
osm_planet_extract --toolchain osmosis osmosis, osmium, osmctools

If you are using osm_planet_extract with --toolchain=osmium, you can also use the --strategy= option to select simple, complete_ways (default) or smart.

If you are using osm_planet_update with --toolchain=osmium, you can also use the --size= option to limit the amount of updates downloaded from the OSM replication server. Osmium requires this data to be held in memory. The default is 1024 megabytes.

Support

To report a bug, please open an issue.

Interline Technologies also provides professional support and consulting services around this and other related tools. Contact us at [email protected] for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].