GIS
HIPAA
The Grass is Greener with Turf.js
luminfire.com/gis
Andrew Walz
GIS Systems Engineer
@andywalz
github.com/andywalz/maptime-turf
Why Turf? Because it’s JavaScript
“Any application that can be written in JavaScript, will eventually be written in JavaScript”
--Jeff Atwood, co-founder of Stack Exchange
“Love it or hate it, the one thing a modern developer cannot do is ignore JavaScript. It is slowly but surely eating your world.”
--Sandeep Bhanot, Salesforce.com/Trailhead Vice President
JavaScript: Today
JavaScript: Today
GIS & JavaScript
GEOJSON
APIs:
GEOJSON
Essential Resources:
Advanced geospatial analysis for browsers and node
→
turf.tin(points);
Simple Modular, simple-to-understand JavaScript functions that speak GeoJSON | Fast Takes advantage of the newest algorithms and doesn't require you to send data to a server | Modular Turf is a collection of small modules. You can require just what you use with browserify |
Turf Functions List
Map Demos
https://www.mapbox.com/bites/00087/
http://geospatialem.github.io/conference-map/
Let’s write some code!
github.com/andywalz/maptime-turf
Node + Turf Demo
Terminal commands:
// Load GeoJson data: statewide libraries and hennepin county polygon
const points = JSON.parse(fs.readFileSync('./data/mn_libraries.geojson'));
const aoi = JSON.parse(fs.readFileSync('./data/hennepin.geojson'));
// Extract only points within aoi
var results = turf.within(points, aoi);
// Write results to a new geojson file
fs.writeFile('./hennepin_libraries.geojson',JSON.stringify(results));
console.log('saved output to hennepin_libraries.geojson, now opening map...');
// Map the Hennipen Co libaries in geojson.io
mapit(results);
// Buffer the libraries to see how much of county is within 2 miles of a libary
polygons = turf.buffer(results,2,'miles');
mapit(polygons);
function mapit(geojson) {
// open package allows open a file or url in the user's preferred application
const open = require('open');
// pass data to geojson.io via url segment
var geojsonUrl = 'http://geojson.io/#data=data:application/json,' + encodeURIComponent(JSON.stringify(geojson));
// open map in default web browser
open(geojsonUrl);
}
https://github.com/andywalz/turf-gislis
LuminFire GIS Plugins and Code
WordPress Plugins
Libraries
FileMaker Demo File
https://brilliantplugins.com/
Questions?
luminfire.com/gis
Andrew Walz
GIS Systems Engineer
@andywalz