Giter Site home page Giter Site logo

a2call / terraformer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from esri/terraformer

0.0 1.0 0.0 55.07 MB

A geographic toolkit for dealing with geometry, geography, formats, and building geo databases

Home Page: http://terraformer.io

License: MIT License

Ruby 2.48% JavaScript 94.52% Shell 0.61% TypeScript 2.39%

terraformer's Introduction

Terraformer

Build Status

A modular toolkit for working with geographic data.

Modules

The Terraformer project is 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 vice versa.
  • ArcGIS Geometry Parser - Parse the ArcGIS Geometry Format into GeoJSON and vice versa.
  • GeoStore - A framework for persisting and querying GeoJSON features with pluggable indexes and persistent stores.

Features

  • Designed to work in Node and the browser
  • No dependencies on 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.

Node.js

Install the core module with npm and then require it in your Node program.

$ npm install terraformer
var Terraformer = require('terraformer');

If needed, supporting packages can be added too.

require('terraformer-arcgis-parser');
require('terraformer-wkt-parser');
require('terraformer-geostore');

Browser

To see Terraformer in action in the browser, check out our live demos. To use it in the browser yourself, reference it using a <script> tag.

<script src="https://unpkg.com/[email protected]"></script>

To utilize supporting packages, you must load their source as well.

<script src="https://unpkg.com/[email protected]"></script>
<script src="https://unpkg.com/[email protected]"></script>

Documentation

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

var polygon = new Terraformer.Primitive({
  "type": "Polygon",
  "coordinates": [
    [
      [-122.665894, 45.5229015],
      [-122.669263, 45.5229165],
      [-122.671151, 45.5184062],
      [-122.673254, 45.5140008],
      [-122.668426, 45.5127378],
      [-122.667654, 45.5169478],
      [-122.665894, 45.5229015]
    ]
  ]
});

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

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.670851, 45.513189], 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. Maintainers can 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.

Licensing

A copy of the license is available in the repository's LICENSE file.

terraformer's People

Contributors

jerrysievert avatar patrickarlt avatar nikolaswise avatar jgravois avatar chelm avatar alaframboise avatar ungoldman avatar darcyparker avatar aaronpk avatar jeffjacobson avatar nixta avatar kenichi avatar paulcpederson avatar jcardonadcdev avatar kyledrake avatar markstos avatar geospatialem avatar techwraith avatar dsmrs avatar knu2xs avatar kristinaweis avatar lyzidiamond avatar mhogeweg avatar sylvainguittard avatar ychongsaytc avatar

Watchers

James Cloos 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.