GithubHelp home page GithubHelp logo

pelias-deprecated / chef-osmpolygons Goto Github PK

View Code? Open in Web Editor NEW
0.0 9.0 0.0 107 KB

Chef cookbook to create OSM admin osmpolygons using the Fences project

License: GNU General Public License v3.0

Ruby 100.00%

chef-osmpolygons's Introduction

osmpolygons

Build Status

What does it do?

Downloads the planet pbf, installs dependencies and extracts admin boundaries from the data. Optionally, you can slice up the resulting data into smaller extracts defined by bounding boxes.

Alternatively, you can choose to specify an alternate pbf (i.e. an extract for example) rather than use the entire planet.

What hardware do I need?

  • ~125GB of free disk space
  • ~12GB of free RAM

How Long Does it Take

  • ~4-8 hours
    • this is largely dependent on the both disk speed for the initial conversion process, and on single cpu core speed for the build process
    • extracting one or more extracts will take a measure of additional time

Contributing

Please fork and create a pull request. At a minimum, verify that your changes are passing basic syntax tests via bundle install && bundle exec rake.

Usage

include_recipe 'osmpolygons::default'

This will install the required dependencies, set up the filesystem structure, download the planet pbf, and process admin boundary data. See the default attributes file to understand (or override) where all this is being placed.

If you would additionally like to extract smaller regions from the resultant data, you can do so in one of two ways. The first is to directly specify the hash as an attribute value, as shown below. Name is translated into a directory (the input will be sanitized if you use spaces, etc).

default[:osmpolygons][:extract][:slices][:hash] = {
  "usa" => {
    "left" => "xxx",
    "bottom" => "xxx",
    "right" => "xxx",
    "top" => "xxx"
  },
  "australia" => {
    "left" => "xxx",
    "bottom" => "xxx",
    "right" => "xxx",
    "top" => "xxx"
  }
}

The second method is to create a file and specify the path to it. This file should be managed directly via a process outside of this cookbook (i.e. in a wrapper cookbook):

node[:osmpolygons][:extract][:slices][:file] = '/etc/a_file.json'

The file should contain json in the format below:

    {
      "usa": {
        "left": "xxx",
        "bottom": "xxx",
        "right": "xxx",
        "top": "xxx"
      },
      "australia": {
        "left": "xxx",
        "bottom": "xxx",
        "right": "xxx",
        "top": "xxx"
      }
    }

Extraction of slices is done in parallel, with the number of parallel jobs defaulting to the total number of CPU cores on the system. This can be overridden in attributes.

See the code for details.

Supported Platforms

Tested and supported on the following platforms:

  • Ubuntu 14.04LTS

Requirements

  • Chef >= 11.4

Attributes

Cookbook Dependencies

apt, user, nodejs

License and Authors

License: GPL Authors: [email protected]

chef-osmpolygons's People

Contributors

heffergm avatar

Watchers

Randy Meech avatar Brett Camper avatar Ian Dees avatar Stephen Hess avatar Peter Johnson avatar Harish Krishna avatar James Cloos avatar Diana Shkolnikov avatar  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.