SlideShare a Scribd company logo
Rule Your Geometry with the
Terraformer Toolkit
Aaron Parecki @aaronpk
CTO, Esri R&D Center Portland
Terraformer
Open Source
JavaScript Geometry Library
Terraformer
 Open

source geometry and geodata library

 Node.js
 Key

and client-side JavaScript

features

 Geometry

format conversions (GeoJSON)
 Geometry operations
 Coordinate system conversion
 Store and access data
github.com/Esri/Terraformer
Terraformer: Geometry and Features

// create a typed primitive from GeoJSON
var point = new Terraformer.Primitive({ "type": "Point", "coordinates": [ 100, 1 ] });

// create a Geometry from coordinates or GeoJSON
var point = new Terraformer.Point( [ 10, 10 ] );
var ls = new Terraformer.LineString([ [ 10, 10 ], [ 20, 20 ]]);
var poly = new Terraformer.Polygon([
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0]]]);
var circle = new Terraformer.Circle([-122.6764, 45.5165], 1000);
// creates a feature from a valid GeoJSON Object
var feature = new Terraformer.Feature({"type": "Point", "coordinates": [ 10, 10 ]}, "properties":
{"prop0": "value0"});
Terraformer: Geometry Operations

// output to Web Mercator and WGS84
primitive.toMercator();
primitive.toGeographic();
Terraformer: Geometry Operations

// add and remove individual points to geometries
multi.addPoint([ 10, 10 ]);
multi.insertPoint([ 10, 10 ],1);
multi.removePoint(1);
multi.get(1);
Terraformer: Geometry Operations

// compute GeoJSON bounding box
bbox = poly.bbox();
// compute x,y,w,h envelope
env = polygon.envelope();
Terraformer: Geometry Operations

// Test whether geometries intersect

polygon1.within(polygon2);
polygon.intersects(line);

polygon.contains(point);
circle.contains(point);
Rule Your Geometry with the Terraformer Toolkit
WKT Conversion
terraformer-wkt-parser.js

// take a WKT representation and convert it into a primative
<script>
var primitive = Terraformer.WKT.parse('LINESTRING (30 10, 10 30, 40 40)');
</script>

// take a primitive and convert it into a WKT representation
var polygon = Terraformer.WKT.convert(
{
"type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
]
}
);
ArcGIS JSON to GeoJSON
terraformer-arcgis-parser.js

<script>
// take ArcGIS JSON and convert to Primitive or GeoJSON
var primitive = Terraformer.ArcGIS.parse({
x:"-122.6764",
y:"45.5165",
spatialReference: {
wkid: 4326
}
});
// take a Primitive or GeoJSON and convert it to ArcGIS JSON
var point = Terraformer.ArcGIS.convert({
"type": "Point",
"coordinates": [45.5165, -122.6764]
});
</script>
Geostore
For Terraformer
Terraformer: GeoStore

A set of building blocks for managing spatial data as a
GeoJSON Feature or FeatureCollection.
Includes functionality for storing and querying data spatially.

Works server-side (Node.js) and in browsers!
Terraformer: GeoStore

Data

Stores
Spatial Indexes
Alternate Indexes
Terraformer: GeoStore
Create a new Store and include both a
Data Store and a Spatial Index.
Terraformer: GeoStore
Add objects to the store!

More Examples
Terraformer: GeoStore
Query the data store using the “within” method

More Examples
Terraformer: GeoStore
Alternate Storage Backends
 LocalStorage

– browser only

 Memory

– browser and Node.js

 LevelDB

– Node.js only

 Future:

??
In Progress:
Terraformer for Ruby!

github.com/esripdx/terraformer-ruby
Licensing
ArcGIS Developer Subscriptions
Licensing
 Free ArcGIS

Developer Subscription

 Testing

and development
 Public deployments (non-commercial)
 50 credits
 Paid ArcGIS

Developer or ArcGIS Organization

Subscription
 Private

deployments
 Commercial deployments (generates revenue)
Rule Your Geometry with the Terraformer Toolkit
esri.github.com

More Related Content

PDF
Java data structures powered by Redis. Introduction to Redisson @ Redis Light...
PPTX
RedisConf17 - Distributed Java Map Structures and Services with Redisson
PDF
RxJS Evolved
PDF
The Ring programming language version 1.5.1 book - Part 63 of 180
PDF
The Ring programming language version 1.6 book - Part 69 of 189
PPTX
Angular2 rxjs
PDF
Using spark data frame for sql
PDF
D3 svg & angular
Java data structures powered by Redis. Introduction to Redisson @ Redis Light...
RedisConf17 - Distributed Java Map Structures and Services with Redisson
RxJS Evolved
The Ring programming language version 1.5.1 book - Part 63 of 180
The Ring programming language version 1.6 book - Part 69 of 189
Angular2 rxjs
Using spark data frame for sql
D3 svg & angular

What's hot (20)

PDF
The Ring programming language version 1.3 book - Part 50 of 88
PDF
RxJS 5 in Depth
PDF
The Ring programming language version 1.5.3 book - Part 77 of 184
PDF
The Ring programming language version 1.10 book - Part 79 of 212
PPTX
Deep dumpster diving 2010
PDF
The Ring programming language version 1.4 book - Part 18 of 30
PDF
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
PDF
yt: An Analysis and Visualization System for Astrophysical Simulation Data
PDF
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PDF
Zone.js 2017
PDF
The Ring programming language version 1.5.4 book - Part 67 of 185
PDF
What they don't tell you about JavaScript
PDF
RxJS - The Reactive extensions for JavaScript
DOCX
PDF
RxJS101 - What you need to know to get started with RxJS tomorrow
DOCX
C programs
KEY
RHadoop の紹介
PPTX
Developing Applications with Microsoft Virtual Earth
KEY
Grand centraldispatch
PDF
The Ring programming language version 1.9 book - Part 77 of 210
The Ring programming language version 1.3 book - Part 50 of 88
RxJS 5 in Depth
The Ring programming language version 1.5.3 book - Part 77 of 184
The Ring programming language version 1.10 book - Part 79 of 212
Deep dumpster diving 2010
The Ring programming language version 1.4 book - Part 18 of 30
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
yt: An Analysis and Visualization System for Astrophysical Simulation Data
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
Zone.js 2017
The Ring programming language version 1.5.4 book - Part 67 of 185
What they don't tell you about JavaScript
RxJS - The Reactive extensions for JavaScript
RxJS101 - What you need to know to get started with RxJS tomorrow
C programs
RHadoop の紹介
Developing Applications with Microsoft Virtual Earth
Grand centraldispatch
The Ring programming language version 1.9 book - Part 77 of 210
Ad

Similar to Rule Your Geometry with the Terraformer Toolkit (20)

PDF
Demoiselle Spatial Latinoware 2011
PDF
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
PPTX
JavaFX Your Way - Devoxx Version
PDF
You will learn RxJS in 2017
PDF
ECMAScript 6 major changes
PPTX
Fact, Fiction, and FP
ODP
Jdd 2016 DROP DATABASE
ODP
JDD 2016 - Jaroslaw Ratajski - DROP DATABASE – przypowieść galaktyczna
PDF
Migrating from Flux to Redux. Why and how.
PPTX
JavaFX 2.0 With Alternative Languages - JavaOne 2011
PDF
Geospatial technologies
PDF
From Node to Go
PDF
Reactive programming with RxJS - ByteConf 2018
PDF
How to build a html5 websites.v1
ODP
DROPDB Galactic story
PDF
Flux and InfluxDB 2.0 by Paul Dix
KEY
OSCON july 2011
PDF
Bindings: the zen of montage
PDF
Wprowadzenie do technologi Big Data i Apache Hadoop
PDF
Application devevelopment with open source libraries
Demoiselle Spatial Latinoware 2011
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
JavaFX Your Way - Devoxx Version
You will learn RxJS in 2017
ECMAScript 6 major changes
Fact, Fiction, and FP
Jdd 2016 DROP DATABASE
JDD 2016 - Jaroslaw Ratajski - DROP DATABASE – przypowieść galaktyczna
Migrating from Flux to Redux. Why and how.
JavaFX 2.0 With Alternative Languages - JavaOne 2011
Geospatial technologies
From Node to Go
Reactive programming with RxJS - ByteConf 2018
How to build a html5 websites.v1
DROPDB Galactic story
Flux and InfluxDB 2.0 by Paul Dix
OSCON july 2011
Bindings: the zen of montage
Wprowadzenie do technologi Big Data i Apache Hadoop
Application devevelopment with open source libraries
Ad

More from Aaron Parecki (20)

PPTX
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
PPTX
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
PPTX
Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013
PPTX
Intro to the ArcGIS Geotrigger Service
PPTX
Low Friction Personal Data Collection - Quantified Self Global Conference 2013
PPTX
Low Friction Personal Data Collection - QS Portland
PPTX
Done Reports - Open Source Bridge
PPTX
Esri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGIS
PPTX
UC2013 Speed Geeking: Intro to OAuth2
PDF
Low Friction Personal Data Collection - Open Source Bridge
PPTX
The State of OAuth2
PPTX
Low Friction Personal Data Collection - CyborgCamp 2012
PPTX
Personal Data Collection Breakout Session Notes
PPTX
An Introduction to OAuth 2
PPTX
An Introduction to OAuth2
PPTX
OAuth 2 at Webvisions
PPTX
Home Automation with SMS and GPS
PDF
The Current State of OAuth 2
PPTX
Ambient Discovery - Augmented Reality Event 2011
PDF
Geolocation in Web and Native Mobile Apps
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013
Intro to the ArcGIS Geotrigger Service
Low Friction Personal Data Collection - Quantified Self Global Conference 2013
Low Friction Personal Data Collection - QS Portland
Done Reports - Open Source Bridge
Esri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGIS
UC2013 Speed Geeking: Intro to OAuth2
Low Friction Personal Data Collection - Open Source Bridge
The State of OAuth2
Low Friction Personal Data Collection - CyborgCamp 2012
Personal Data Collection Breakout Session Notes
An Introduction to OAuth 2
An Introduction to OAuth2
OAuth 2 at Webvisions
Home Automation with SMS and GPS
The Current State of OAuth 2
Ambient Discovery - Augmented Reality Event 2011
Geolocation in Web and Native Mobile Apps

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Machine learning based COVID-19 study performance prediction
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation theory and applications.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Assigned Numbers - 2025 - Bluetooth® Document
Per capita expenditure prediction using model stacking based on satellite ima...
Machine learning based COVID-19 study performance prediction
“AI and Expert System Decision Support & Business Intelligence Systems”
The Rise and Fall of 3GPP – Time for a Sabbatical?
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A comparative analysis of optical character recognition models for extracting...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation_ Review paper, used for researhc scholars
Building Integrated photovoltaic BIPV_UPV.pdf

Rule Your Geometry with the Terraformer Toolkit

  • 1. Rule Your Geometry with the Terraformer Toolkit Aaron Parecki @aaronpk CTO, Esri R&D Center Portland
  • 3. Terraformer  Open source geometry and geodata library  Node.js  Key and client-side JavaScript features  Geometry format conversions (GeoJSON)  Geometry operations  Coordinate system conversion  Store and access data github.com/Esri/Terraformer
  • 4. Terraformer: Geometry and Features // create a typed primitive from GeoJSON var point = new Terraformer.Primitive({ "type": "Point", "coordinates": [ 100, 1 ] }); // create a Geometry from coordinates or GeoJSON var point = new Terraformer.Point( [ 10, 10 ] ); var ls = new Terraformer.LineString([ [ 10, 10 ], [ 20, 20 ]]); var poly = new Terraformer.Polygon([ [[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0]]]); var circle = new Terraformer.Circle([-122.6764, 45.5165], 1000); // creates a feature from a valid GeoJSON Object var feature = new Terraformer.Feature({"type": "Point", "coordinates": [ 10, 10 ]}, "properties": {"prop0": "value0"});
  • 5. Terraformer: Geometry Operations // output to Web Mercator and WGS84 primitive.toMercator(); primitive.toGeographic();
  • 6. Terraformer: Geometry Operations // add and remove individual points to geometries multi.addPoint([ 10, 10 ]); multi.insertPoint([ 10, 10 ],1); multi.removePoint(1); multi.get(1);
  • 7. Terraformer: Geometry Operations // compute GeoJSON bounding box bbox = poly.bbox(); // compute x,y,w,h envelope env = polygon.envelope();
  • 8. Terraformer: Geometry Operations // Test whether geometries intersect polygon1.within(polygon2); polygon.intersects(line); polygon.contains(point); circle.contains(point);
  • 10. WKT Conversion terraformer-wkt-parser.js // take a WKT representation and convert it into a primative <script> var primitive = Terraformer.WKT.parse('LINESTRING (30 10, 10 30, 40 40)'); </script> // take a primitive and convert it into a WKT representation var polygon = Terraformer.WKT.convert( { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ], [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ] ] } );
  • 11. ArcGIS JSON to GeoJSON terraformer-arcgis-parser.js <script> // take ArcGIS JSON and convert to Primitive or GeoJSON var primitive = Terraformer.ArcGIS.parse({ x:"-122.6764", y:"45.5165", spatialReference: { wkid: 4326 } }); // take a Primitive or GeoJSON and convert it to ArcGIS JSON var point = Terraformer.ArcGIS.convert({ "type": "Point", "coordinates": [45.5165, -122.6764] }); </script>
  • 13. Terraformer: GeoStore A set of building blocks for managing spatial data as a GeoJSON Feature or FeatureCollection. Includes functionality for storing and querying data spatially. Works server-side (Node.js) and in browsers!
  • 15. Terraformer: GeoStore Create a new Store and include both a Data Store and a Spatial Index.
  • 16. Terraformer: GeoStore Add objects to the store! More Examples
  • 17. Terraformer: GeoStore Query the data store using the “within” method More Examples
  • 18. Terraformer: GeoStore Alternate Storage Backends  LocalStorage – browser only  Memory – browser and Node.js  LevelDB – Node.js only  Future: ??
  • 19. In Progress: Terraformer for Ruby! github.com/esripdx/terraformer-ruby
  • 21. Licensing  Free ArcGIS Developer Subscription  Testing and development  Public deployments (non-commercial)  50 credits  Paid ArcGIS Developer or ArcGIS Organization Subscription  Private deployments  Commercial deployments (generates revenue)

Editor's Notes

  • #2: Esri Corporate Template V2September 6, 2013See http://arczone/resources/presentations.cfm for more sample files and help.
  • #8: ----- Meeting Notes (11/20/13 09:22) -----add example output
  • #10: ----- Meeting Notes (11/20/13 09:22) -----what&apos;s the difference between arcgis json and geojson
  • #12: ----- Meeting Notes (11/20/13 09:22) -----can you specify a spatial reference in geojson?
  • #17: ----- Meeting Notes (11/20/13 09:22) -----show example of geojson object before adding it to the store with the ID