Download presentation
Presentation is loading. Please wait.
1
Writing Geoprocessing Scripts With ArcGIS
Lecture 10 04/1/2008 ArcGIS 9 introduces scripting support for many of today’s most popular scripting environments, such as Python, VBScript, JScript™, and Perl. Python is an easy-tolearn language similar to C. Python has the ease of use of a scripting language, along with the programming capabilities of a complete developer language. Moreover, Python is platform independent and can operate on a variety of operating systems including UNIX®, Linux®, and Windows.
2
GIS System
3
Development tool The ArcGIS system is built and extended using ArcObjects software components. ArcObjects includes a wide variety of programmable components. Developers work with ArcObjects using standard programming frameworks to extend ArcGIS Desktop, build custom applications with ArcGIS Engine, and implement server GIS applications for various enterprise purposes using ArcGIS sever. The ArcGIS system is built and extended using ArcObjects software components. ArcObjects includes a wide variety of programmable components, ranging from fine-grained objects (for example, individual geometry objects) to coarse-grained objects (for example, a map object to interact with existing ArcMap documents), which aggregate comprehensive GIS functionality for developers. Developers work with ArcObjects using standard programming frameworks to extend ArcGIS Desktop, build custom applications with ArcGIS Engine, and implement server GIS applications for various enterprise purposes using ArcGIS sever.
4
VBA and Python
10
ArcMap Objects Link
12
A new ArcObjects™ component, the geoprocessor, manages all the geoprocessing functions available within ArcGIS. It is an object that provides a single access point and environment for the execution of any geoprocessing tool in ArcGIS, including extensions. The geoprocessor implements automation using the COM IDispatch interface, making it possible for interpretative and macro languages to access the more than 400 available tools. GpDispatch is the COM name for the geoprocessor IDispatch object. In Python, the Dispatch method on the win32com module’s client object is used to create the geoprocessor, while Visual Basic and VBScript use the CreateObject function.
17
Python Basics
20
Variable index Word[0]=‘H’ Word[2:4]=‘lp’ Word[:3]=‘Hel’
Word[-2:-4]=‘el’ Word[-3:]=‘lpA’
26
Scripts Examples
27
Does not work in your computer
28
Create a new geoprocessor
Add the toolbox
29
Extract the radar rainfall using raingauges location.
Objective: compare the radar and rain gauge rainfall measurements Data source: Polygon-feature class of radar rainfall (>10k files); Point-feature of rain gauge locations (50 gauges); Method: interception Final format: all values are stored at one *.txt file.
30
Study Area
34
Exploring more ArcGIS Teaching yourself.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.