Git Product home page Git Product logo

edge-clipper's Introduction

Edge Clipper

Usage

The only requirements are to download this repository and install Docker Desktop. Add files to the included inputs directory, where they'll be processed to the outputs directory. Within the inputs directory, there are two subdirectories:

  • inputs/adm0: This is the global admin level 0 file used for clipping.
  • inputs/admx: Contains all the subnational admin layers in extended formats. There can be a mix of different admin levels contained within this directory.

Make sure Docker Desktop is running, and from the command line of the repository's root directory, run the following. Note that docker compose build is only required for the first run, or if upgrading from a previous version.

docker compose build
docker compose up

Configuration

This tool relies on an environment file to configure runtime parameters. Before running this tool, make a copy of the .env.example file and rename it to .env.

cp .env.example .env

The following options control how the tool runs:

  • ADM0_JOIN: In the admin level 0 file located at inputs/adm0, this is the column used to match polygons used to clip lower level extended files in inputs/admx. For example, a column value of CAN will specify the polygon used to clip inputs/admx/CAN.gpkg.
  • ADM0_ID: A column containing a unique ID for the admin level 0 layer. This is needed to ensure the ADM0 features are preserved when dissolving, for example from ADM2 to ADM1.
  • ADMX_ID: A column template for the unique IDs of subnational layers. This is needed to ensure that features are preserved when dissolving, for example from ADM2 to ADM1. Use the placeholder {x} to refer to the admin level, for example adm{x}_id.
  • ADMX_COLUMNS: Additional columns specific to each admin level of a layer, comma separated. Use the placeholder {x} to refer to the admin level, for example adm{x}_name.
  • ADM_LEVELS: Configures what admin level to build down to. For example, if set to 4, it will build out layers for admin levels 1, 2, 3, and 4.
  • THROTTLE: Subnational boundary processing is done in parallel, running 1 process per CPU core. Doing this may cause Docker to crash if it runs out of RAM by loading too many datasets into memory at the same time. You may see this with errors such as psycopg.OperationalError: consuming input failed. Increasing the throttle will decrease the amount of work done in parallel, for example setting the throttle to 1.5 will cause the system to run 1 process per 1.5 CPU cores.
  • DOWNLOAD: When set to YES, the tool downloads data from FieldMaps that serves as a useful starting point for customizing with external data. Data will be downloaded for ADM0, as well as downloading all subnational CODs and geoBoundaries data. If files with the same name already exist in the inputs directory, they will be skipped.

edge-clipper's People

Contributors

maxmalynowsky avatar

Watchers

Kostas Georgiou 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.