Terraformer
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 = ;
If needed, supporting packages can be added too.
;;;
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.
To utilize supporting packages, you must load their source as well.
Documentation
Make sure you check out the full documentation on the Terraformer website and the getting started guide.
var polygon = "type": "Polygon" "coordinates": -122665894 455229015 -122669263 455229165 -122671151 455184062 -122673254 455140008 -122668426 455127378 -122667654 455169478 -122665894 455229015 ; var point = "type": "Point" "coordinates": -122669477 45517760;
Now that you have a point and a polygon primitive you can use the primitive helper methods.
// add a new vertex to our polygonpolygon; // figure out if our point is within our polygonpoint; // returns true
You can also have Terraformer perform many geometric operations like convex hulls and bounding boxes.
var convexHull = polygon; point; // returns true var boundingBox = polygon; // 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.