Giter VIP home page Giter VIP logo

terraformer's Introduction

Terraformer

Terraformer is a modular toolkit for working with geographic data.

Modules

The Terraformer project to broken up into a series of smaller modules.

  • Terraformer Core - Contains methods and objects for working with GeoJSON. This also contains common methods used by other modules.
  • WKT Parser - Parse Well Known Text into GeoJSON and vica-versa.
  • ArcGIS Geometry Parser - Parse the ArcGIS Geometry Format into GeoJSON and vica-versa.
  • GeoStore - A framework for persisting and querying GeoJSON features with pluggable indexes and persistant stores.

Features

  • Designed to work in Node and the browser
  • No dependancies of other tools or libraries

Getting Started

Check out the getting started guide which will give you an overview of core concepts and methods in Terraformer.

Documentation

Make sure your check out the full documentation on the Terraformer website and the getting started guide.

var polygon = new Terraformer.Primitive({
  "type": "Polygon",
  "coordinates": [
    [
      [-122.66589403152467, 45.52290150862236],
      [-122.66926288604736, 45.52291654238294],
      [-122.67115116119385, 45.518406234030586],
      [-122.67325401306151, 45.514000817199715],
      [-122.6684260368347, 45.5127377671934],
      [-122.66765356063841, 45.51694782364431],
      [-122.66589403152467, 45.52290150862236 ]
    ]
  ]
});

var point = new Terraformer.Primitive({
  "type": "Point",
  "coordinates": [-122.66947746276854, 45.51775972687403]
});

Now that you have a point and a polygon primitive you can use the primitive helper methods.

// add a new vertex to our polygon
polygon.insertVertex([-122.6708507537842, 45.513188859735436], 2);

// figure out if our point is within our polygon
point.within(polygon); // returns true

You can also have Terraformer perform many geometric operations like convex hulls and bounding boxes.

var convexHull = polygon.convexHull();

point.within(convexHull); // returns true

var boundingBox = polygon.bbox(); // returns the geojson bounding box for this object.

Resources

Building the documentation

To build the site locally, first bundle install then bundle exec middleman to run a local server. Once you're satisfied, run bundle exec middleman build, then grunt gh-pages to deploy to github pages.

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

[](Esri Tags: Terraformer GeoJSON) [](Esri Language: JavaScript)

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.