Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing...
Transcript of Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing...
![Page 1: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/1.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/2.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/3.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/4.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/5.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/6.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/7.jpg)
Tasks in Web Applications
![Page 8: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/8.jpg)
Tasks in Web Applications
• Geoprocessing tasks can be accessed through all ArcGIS Web APIs in four simple steps
1. Initialize task 2. Setup task parameters 3. Run the task 4. Get results from the task.
![Page 9: Using Geoprocessing Services with ArcGIS Web … geoprocessing task provides a unique geoprocessing functionality. • A geoprocessing service can have more than one geoprocessing](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/9.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/10.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/11.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/12.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/13.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/14.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/15.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/16.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/17.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/18.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/19.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/20.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/21.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/22.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/23.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/24.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/25.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/26.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/27.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/28.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/29.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/30.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/31.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/32.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/33.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/34.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022110112/5aeda03f7f8b9ab24d91c332/html5/thumbnails/35.jpg)
Questions ?
Please fill session survey!