Top Banner
Michael Lippmann, Blue Raster Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js Alicia Barnash Brendan Collins Robert Winterbottom
43

Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

May 06, 2015

Download

Technology

Blue Raster

2014 Esri International Developer Summit User Presentation

Learn strategies for developing cross-platform suitability analysis applications using ArcGIS Image Server D3 and Knockout.
Round 1: Suitability Web Services, automating raster pre-processing and mosaic creation, creating custom raster functions, publishing and consuming image services
Round 2: Visualization, calculating statistics for user drawn polygons, displaying results using D3, creating map and raster data export
Round 3: Building the App, building suitability user interfaces in JavaScript, mobile development strategies, managing data using Knockout
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Michael Lippmann, Blue Raster

Total Knockout:

Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Alicia BarnashBrendan CollinsRobert Winterbottom

Page 2: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Pattern: Online Mapping Applications

• Focused Applications

• Curated map experience

• Mobile apps• Open Data APIs• Near real time data

Page 3: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

• Determine locations with necessary qualities for a specific purpose.

• Ability to consume and customize analysis via web-connected devices.

Raster-based Suitability Analysis for the Web

Page 4: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Elevation

Page 5: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Landcover

Page 6: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Peat Soil Depth

Page 7: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Rainfall

Page 8: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Slope

Page 9: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Euclidean Distance from Conservation Areas

Page 10: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Soil Type

Page 11: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Soil Acidity

Page 12: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Soil Depth

Page 13: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Raster-based Suitability Analysis for the Web

• User provides thresholds for various criteria

• Each variable has a corresponding layer within Image Service.

Page 14: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Suitability Server-side Setup

• Preprocessing Data– Optimizing data for

ArcGIS Server.

• Create Image Service– Raster functions

replace custom server development.

Page 15: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Preprocessing with Arcpy

SDR

Page 16: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Preprocessing with Arcpy

arcpy.Describe(raster)

– Raster Format– NoData Value–Mean Cell Height / Width (resolution)– Pixel Type– Spatial Reference– Read Documentation

SDR

Page 17: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Preprocessing using Arcpy

arcpy.Reclassify(raster)

– Convert Floats to Integers– Remove Irrelevant Values– Read Documentation

SDR

Page 18: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Preprocessing using Arcpy

arcpy.Resample(raster)

– Create Common Resolution– Align Raster Pixels– Create Common Extent– Read Documentation

SDR

Page 19: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Preprocessing using Arcpy

Additional Helper Functions

• arcpy.CreateFileFDB– Read Documentation

• arcpy.CreateMosaicDataset– Read Documentation

• arcpy.AddRastersToMosaicDataset– Read Documentation

• arcpy.EditRasterFunction– Read Documentation

Page 20: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Create Raster Function Chains

Page 21: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Overview- Client Side Workflow

Request/Receive Image Server Data

Add to KO View Model

UI automatic refresh with KO Data Binding

function Callback(response){…return(data);

}

ViewModel.histograms(data);

<div class = “dataTitle” data-bind = “text:imageData().title”>…</div>

Page 22: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Requesting Image Service Data

Use Image Service Raster Functions to:- Update Mosaic Rendering- Get Raster Statistics- Export Images

based on User selected settings

Page 23: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js
Page 24: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js
Page 25: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Requesting Image Service Data

Page 26: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Requesting Image Service Data

/exportImage?/computeHistograms?

Page 27: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Add Image Service data to View Model

Page 28: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Knockout JS Library

Advantage: No need to write code/event handlers to update DOM directlyevery time the User changes suitability settings.Write Less Code

Page 29: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

MVVM Design Pattern

Separate: Data Model - Presentation

Stored DataCode representation of data and operations on UI

User Interface

Page 30: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Initialize View Model

Page 31: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Update View Model with Image Service Data

Page 32: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Knockout Bindings

• visible• text• html• foreach• attr• click• Or use for storage

of particular settings.

Page 33: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Knockout: How it Works

Page 34: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Knockout: What else can we use it for?

Page 35: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Knockout: What else can we use it for?

Page 36: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Data Visualization with D3 and Highcharts

• D3 is a fantastic data visualization library, not a charting library.

• D3 has the ability to create some really beautiful visualizations.

• Highcharts is a simple plug and play charting library.

Page 37: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

D3 Examples

Page 38: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

D3 Examples (cont.)

Page 39: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

D3 & Highcharts

Page 40: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

D3 & Highcharts (cont.)

Page 41: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Thinking Mobile

• Mobile is changing the game and cannot be ignored.

• Develop an application using JavaScript with a mobile friendly UI.

• Test on a real device, emulator’s, simulator’s, and resizing browser windows is not enough.

Page 43: Total Knockout: Start-to-Finish Development of Suitability Applications Using Image Server, D3.js, and Knockout.js

Q & A

Portfolio available at blueraster.com/blog

@aspacebarnash

@brendancol

@rwinter85

Alicia Barnash

Brendan Collins

Robert Winterbottom