using geoprocessing services with arcgis web … geoprocessing task provides a unique geoprocessing...

35
Using Geoprocessing Services with ArcGIS Web Mapping APIs Monica Joseph, Scott Murray Please fill session survey.

Upload: lenhi

Post on 05-May-2018

237 views

Category:

Documents


18 download

TRANSCRIPT

Page 1: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Using Geoprocessing Services with ArcGIS Web Mapping APIs

Monica Joseph, Scott Murray

Please fill session survey.

Page 2: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

What is a Geoprocessing Service?

• A geoprocessing service is a set of geoprocessing tools running at server.

ArcGIS Server

Flex

Silverlight

JavaScript

Mobile APIs

ArcGIS for Desktop

Publish

Page 3: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

What is a geoprocessing task?

• A geoprocessing task provides a unique geoprocessing functionality.

• A geoprocessing service can have more than one geoprocessing task.

• Each task has a REST URL. • REST URL: http://<catalog-url>/<serviceName>/GPServer/<taskname>

Example of GP Task

Page 4: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Task Parameters

• Every Task has its own parameters • Task Parameters are of two categories:

- 1. Input parameters - 2. Output parameters

Web Applications ArcGIS Server Input parameters

Output parameters

Page 5: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Task parameter

• Types: - FeatureSet - RecordSet (Tables) - Raster - Linear Unit (100 Km, 50 Miles…) - File (.xml, .gpx, .txt, .zip ….) - Integer, Long, Double - Date - Boolean

Page 6: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Task Operations

• Task supports two kinds of operations 1. Execute Task : For faster processes

- Execution Mode : Synchronous 2. Submit Job : For long running processes (more than

10 secs) - Execution Mode : Asynchronous

Page 7: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Tasks in Web Applications

Page 9: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Demo Using tasks

Page 10: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Recap

• What is a Geoprocessing Service ? • Task, its Parameters and Execution type • Using tasks in web applications

- Use graphics as input featureset - Execute Synchronous execution - Draw a chart with the result

Page 11: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

10.1 Goodness Improved Featureset parser

Page 12: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

10.1 Goodness – Improved Featureset Parser

• Input schema sent by the client takes precedence over default schema defined by the task.

• Empty input schema to indicate support for all geometry types and fields.

• Output Featuresets return field property.

Page 13: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

What is Featureset Schema?

• Featureset Schema = GeometryType + Spatial Reference + Fields (attributes) • Default value of a featureset parameter represents

the default schema for input featuresets.

Page 14: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Why is schema important?

• Schema is important to create feature class at the server.

• Schema may come from client, if not use default schema.

ArcGIS Server

JSON

JSON

Feature Class

Web Applications

Points, Lines, Polygons

FeatureSet Parser

Used as Input

Page 15: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Defining Schema How can clients define schema?

{ "geometryType" : "esriGeometryPoint", "fields":[ {"name":"Id","type“: "esriFieldTypeOID","alias":"Id"},

{"name":"Name","type":"esriFieldTypeString","alias":"Name“}], "spatialReference" : {"wkid" : 4326},

"features" : [ { "geometry" : {"x" : -104.44, "y" : 34.83,

"spatialReference" : {"wkid" : 4326}},

"attributes" : {"Id" : 43,"Name" : "Feature 1"}},

{ "geometry" : {"x" : -100.65, "y" : 33.69,

"spatialReference" : {"wkid" : 4326}},

"attributes" : {"Id" : 42,"Name" : "Feature 2"}} ]

}

• By sending appropriate JSON

Page 16: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Empty Default Schema

• Empty default value (schema) represents support for any geometry and any fields.

Caution: Clients must specify schema!

Page 17: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Output Featuresets

{ "geometryType" : "esriGeometryPoint", "fields":[ {"name":"Id","type“: "esriFieldTypeOID","alias":"Id"},

{"name":"Name","type":"esriFieldTypeString","alias":"Name“}], "spatialReference" : {"wkid" : 4326},

"features" : [ { "geometry" : {"x" : -104.44, "y" : 34.83,

"spatialReference" : {"wkid" : 4326}},

"attributes" : {"Id" : 43,"Name" : "Feature 1"}},

{ "geometry" : {"x" : -100.65, "y" : 33.69,

"spatialReference" : {"wkid" : 4326}},

"attributes" : {"Id" : 42,"Name" : "Feature 2"}} ]

}

• Output Featuresets will also have Fields property.

Page 18: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Recap

• Input Featureset Schema - What is schema and why is it important?

• 10.1 goodness - Client defined schema takes precedence. - No schema input featureset - Output featureset returns field property

Page 19: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Demo 10.1 Featureset

Page 20: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Result Map Service

Page 21: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Result Map Service (RMS) Task results are returned as map service

• GP Tasks without RMS

Info: RMS is supported only for asynchronous execution

Web Applications ArcGIS Server JSON input

JSON output

Web Applications ArcGIS Server JSON input

JSON output +

Map Service

• GP Tasks with RMS

Page 22: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

RMS Advantages

• Supports large dataset return values. • Pre-cooked symbology. • Raster outputs as layers. • Support for advanced layers such as TIN, CAD etc.

Page 23: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

10.1 Goodness Improved Result Map Service

Page 24: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Improved RMS

• Easy to access map service and its layers • Download features based on query (Web API Feature

Layer support) • Dynamic Legends • Time enabled layers • Attachments and esriHTMLPopup support

In one word: 10.1 RMS is a true Dynamic Map Service!

Page 25: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Demo: Result Map Service

Page 26: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Recap

• RMS is a map service of task results. • 10.1 RMS is a true dynamic Map Service. • Demo:

- Asynchronous execution of tasks - Using RMS layers

Page 27: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

File Inputs

Page 28: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Files in Geoprocessing Services

• Files such as gpx, csv, photos, zip files are processed using geoprocessing tool.

• Some examples: - GPX to Features - Table to Table (csv input) - Geotagged Photos to Points

• Other file types can also be processed using Python.

Page 29: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

10.1 Goodness File Uploads

Page 30: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

File Uploads

• New capability for Geoprocessing Service : Uploads • Enabled/Disabled when publishing geoprocessing

service

Page 31: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

What is File Upload

• Upload local input files to ArcGIS Server. • Use uploaded file as input to Geoprocessing tasks

Web Applications ArcGIS Server File

itemID

Web Applications ArcGIS Server itemID

Task Output

Page 32: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

itemID

• itemID refers to a file living in ArcGIS Server. • itemID can be specified as input to Raster and File inputs of

tasks. • JSON representation of itemID.

- Example: {itemID: “i2e56c31c-70b8-40d9-9b4e-687f6b6110ea”}

Page 33: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Demo: Uploading Files

Page 34: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Recap

• Uploads is a new geoprocessing service capability. • ItemID can be used as input to Task parameters.

Page 35: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing

Questions ?

Please fill session survey!