Geoprocessing(Building Your Own Tool) and Geostatistical Analysis(An Introduction) Using Python...

27
GEOPROCESSING –Build Your Own Tools using Python Script GEOSTATISTICAL ANALYSIS in Arc GIS using python: An Introduction Group Members: Bibek Karki(13) Upendra Oli(19) Uttam Pudasaini(22)

description

Its a presentation slide prepared by me and my team for a workshop at my college.Don't hesitate to mail me at [email protected] or [email protected] if you want to know more or details regarding the demos.

Transcript of Geoprocessing(Building Your Own Tool) and Geostatistical Analysis(An Introduction) Using Python...

Page 1: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

GEOPROCESSING –Build Your Own Tools using Python Script

GEOSTATISTICAL ANALYSIS in Arc GIS using python: An Introduction

Group Members:Bibek Karki(13)Upendra Oli(19)Uttam Pudasaini(22)

Page 2: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

CONTENTS

Simple tool using python script Iteration in script tool Geostatistical Analysis(arcpy.ga Introduction )

Page 3: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

GEOPROCESSING :For everyone that uses ArcGIS

The fundamental purpose of Geoprocessing is to Provide tools and a framework for performing analysis and managing

geographic data.

Geoprocessing provides a large suite of tools for performing GIS tasks that range from Simple buffers and polygon overlays to Complex regression analysis and

Image classification.

All geo-processing tools are available as Python through the “ArcPy” module that ships with ArcGIS 10

Page 4: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

A script tool that you create is an integral part of geoprocessing, just like a system tool

To create a script tool in a custom toolbox, you need three things: A script A custom toolbox A precise definition of the parameters of your script

Page 5: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Related Functions to create your own Script toolGetParameterAsText()GetParameter()Os.pathAddMessage()GetMessages()ValidateTableName()Os.path.join()

Page 6: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Related Function Contd…GetParameterAsText()GetParameterAsText reads the user input for the

output file location (for example) as a text string.

…String = arcpy.GetParameterAsText(index)

Page 7: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Related Function Contd…

GetParameter()

GetParameter reads user input and returns an object (e.g., Boolean).

…..Object = arcpy.GetParameter(0)

Page 8: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Related Function Contd…

arcpy.GetMessages(index)Returns a geoprocessing tool message by its index

position.

Page 9: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Related Function Contd…

arcpy.AddMessage()Creates a geoprocessing informative message that can be accessed with any of the GetMessages functions.

arcpy.AddMessage(arcpy.GetMessages(index))

Page 10: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Related Function Contd…

Import OsThe Os module contain functions the script will

need for working with files on disk.

• Os.path.join()Joins the two input arguments to a single string

Page 11: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Related Function Contd…

ValidateTableName (name, {workspace})

Takes a table name and a workspace path and returns a valid table name for the workspace.

An underscore "_" will replace any invalid character found in the table name

NAME AND WORKSPACE-stringRETURN TYPE-string

Page 12: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

DEMO 1:SIMPLE SRCIPT TOOL

DEMO 2:ITERATION ON SCRIPT TOOL

Page 13: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Geostatistical Analysis

Page 14: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

ArcPy is supported by a series of modules, including a Mapping module(arcpy. mapping),

Spatial Analyst module(arcpy.sa),

Geostatistical Analyst module(arcpy.ga).

Page 15: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Geostatistics Geostatistics is a class of statistics

used to analyze and predict the values associated with spatial or spatiotemporal phenomena.

A practical means to describe spatial patterns and interpolate

values for locations where samples weren’t taken

Page 16: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Geostatistical Analysis Tools

Page 17: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Geostatistical Analysis classesGeostatistical Analyst classes are used for defining parameters

for Geostatistical Analyst tools that may have a varying number of arguments depending on the parameter type selected

ClassesCross ValidationResultSearchNeighbourhoodSmoothSearchNeighbourhoodStandard

Page 18: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

CrossValidationResult: To compare the predicted value to the observed value in

order to obtain useful information about model parameters. Removes one data location and then predicts the associated data

using the data at the rest of the locations.

Takes Geostatistical Layer as Input

Page 19: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

• DEMO• Cross Validation Result• Create Geostatistical Layer From XML of your model

Page 20: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

SearchNeighborhoodStandard

It is used to define the search neighbourhood for IDW, Local Polynomial Interpolation, and Radial Basis Functions.

Page 21: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Takes following Arguments

majorSemiaxis: The distance, in map units, specifying the length of the

major semi axis of the ellipse within which data is selected from.

minorSemiaxis: The distance, in map units, specifying the length of the

minor semi axis of the ellipse within which data is selected from.

Angle: The angle of the search ellipse.

Page 22: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

nbrMax: Maximum number of neighbors, within the search ellipse, to

use when making the prediction.

nbrMin: Minimum number of neighbors, within the search ellipse, to

use when making the prediction.

sectorType: The searching ellipse can be divided into 1, 4, 4 with an

offset of 45º, or 8 sectors.

Page 23: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

• DEMO[With Change in Ellipse Parameters]

Page 24: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

SearchNeighborhoodSmooth

Used to define the search neighborhood for IDW, Local Polynomial Interpolation, and Radial Basis Functions(only when the

INVERSE_MULTIQUADRIC_FUNCTION keyword is used).

Page 25: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

Takes following Arguments

majorSemiaxis: The distance, in map units, specifying the length of the

major semi axis of the ellipse within which data is selected from.

minorSemiaxis:The distance, in map units, specifying the length of the

minor semi axis of the ellipse within which data is selected from.

Angle:The angle of the search ellipse.

smoothFactor Determines how much smoothing will be performed. 0 is

no smoothing; 1 is the maximum amount of smoothing.

Page 26: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

• Demo

Page 27: Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introduction) Using Python Scripts

THANK YOU