Giter VIP home page Giter VIP logo

atlas-generator's Introduction

AtlasGenerator

Build Status

AtlasGenerator is a Spark Job that generates Atlas shards from OSM pbf shards (built from an OSM database with osmosis).

Getting started

It is recommended to use Oracle's latest JDK 1.8 with that project.

Build

This command will create the necessary fat (contains all the dependencies) and shaded (contains all the dependencies, except spark and hadoop) jars.

gradle clean shaded fat

Setup example: BLZ (Belize)

Download the country boundaries and the sharding tree files from the respective sub-folders available here. We will then call file:///path/to/boundaries/world_boundaries_osm_20170424.txt and file:///path/to/sharding/tree-6-14-100000.txt the boundaries and sharding files just downloaded. Finally download the latest .osm.pbf from geofabrik here. We will call the folder that contains it file:///path/to/pbf.

We will also trick the program into thinking that the 3 shards Belize intersects with in this sharding tree each have a corresponding .osm.pbf file, which will each just be the same copy of the file that was downloaded from geofabrik:

cp /path/to/pbf/belize-latest.osm.pbf /path/to/pbf/7-32-57.pbf
cp /path/to/pbf/belize-latest.osm.pbf /path/to/pbf/8-64-117.pbf
cp /path/to/pbf/belize-latest.osm.pbf /path/to/pbf/8-65-117.pbf

Run

The AtlasGenerator is a SparkJob that can be run directly from a simple java command. Assuming /path/to/jars contains a fat jar version built from this project here is a sample command that can run locally.

java -classpath "/path/to/jars/*" org.openstreetmap.atlas.generator.AtlasGenerator \
    -output=file:///path/to/BLZ/output \
    -master=local \
    -startedFolder=file:///path/to/BLZ/started \
    -countries=BLZ \
    -countryShapes=file:///path/to/boundaries/world_boundaries_osm_20170424.txt \
    -pbfs=file:///path/to/pbf \
    -sharding=dynamic@file:///path/to/sharding/tree-6-14-100000.txt \
    -sparkOptions=spark.executor.memory->10g,spark.driver.memory->10g

Result

The above command should do the following:

  • Create a _STARTED empty file in the started folder to indicate that it started
  • Create 3 atlas shards in /path/to/BLZ/atlas

Those 3 files can be loaded together at once, in the JOSM Atlas plugin for example, or programmatically loaded with a MultiAtlas using the AtlasResourceLoader from the atlas project.

Contributing

Please see the contributing guidelines!

atlas-generator's People

Contributors

matthieun avatar mikegost avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.