Git Product home page Git Product logo

astro-turf's Introduction

astro-turf

allows you to run turf functions on streaming line delimited json

specifying methods

use --method

astro --method=bboxPolygon

accepted method names are any turf module

methods that take additional parameters

If you want to call a method that requires other parameters, for example, buffer, use --args. $ is a standin for the streaming line input. Note that the value of --args must be quoted if it contains strings or objects.

cat polygons.json | astro --method=buffer --args='$,10,"miles"'

splitting feature collections

If the input contains feature collections, they can be split so that each feature is processed separately using --splitCollections. This is useful when piping the input from another task that outputs feature collections (like turf-random does)

echo '[-122.8,37.2,-121.7,37.9]' | \
  astro --method=random --args='"point",1000,{"bbox":$}' | \
  astro --splitCollections --method=buffer --args='$,100,"miles"'

parallel processing (experimental)

Processing can be done in parallel, using one worker per CPU core via the -P flag. Unless you are doing especially heavy operations (such as complex unions, large merges, etc) this is not advised, because the cost of sending messages between processes usually outweighs the benefit of processing in parallel.

astro-turf's People

Contributors

tcql avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.