Académique Documents
Professionnel Documents
Culture Documents
often performed on a number of different datasets or on large datasets with numerous records.
Using ArcGis Tools to process GIS Data
geoprocessing tasks. Scripting allows the execution of simple processes (a single tool) or complex processes (piggybacked, multitool tasks with validation). Scripts are recyclable, meaning they can be data nonspecific and used again.
Script: is a set of computing instructions, usually
Tools in Arcgis
All commands (otherwise known as tools) are
Model Tool
Script Tool
Custom Tool
System Tools
Usually, these tools are installed and registered when you install ArcGIS. Although third-party developers can also create and register system tools. System tools are sometimes called function tools by developers.
Model Tools
These tools are created by user with Model Builder. Some of the tools in the system toolboxes are model tools.
Script Tools
Created by user with a scripting language editor (typically an enhanced text editor). Some of the tools in the system toolboxes are script tools.
Custom tools
Built by system developers and have
their own unique user interface for creating the tool. The ArcGIS Data Interoperability extension contains custom tools.
Python
Open Source
Object Oriented Multi-Platform Good Debugging Tools Installed with ArcGis ESRI samples provided
Python
Python is simple to learn because of its clean syntax and simple, clear concepts. Python supports object-oriented programming in an easy-to-understand manner. Documenting Python is easy because it has readable code. Complicated data structures are straightforward to work with in Python. Python is simple to integrate with C++ and Fortran.
Using the native arcgis scripting module, depending on version of software version you have.
Arcgis Libraries
www.python.org
Divide and Conquer Write and draw a chart of required steps Conceptualize the problems and solutions Look at ArcGis Desktop Help Find tools in ArcGis
Concepts Continued
The easiest way to start is to create a model, and export
Concepts again
Each Tool has a scripting help associated with it
Tools Aliases
An Example of Geoprocessing
An Example: DSP data processing
Radar Attributes
Hundreds of files similar to this one Records from two radars KEWX KDFX
Cartography
Conversion Management
Geostatistical Analyst
Spatial Statistics
Intersect Tool
My Model
Define Projection
Intersect
Export Attributes to ASCII file
Operating System
File and Folders Path
The locale module opens access to the POSIX locale database and functionality
GP.defineprojection(fc, coordsys)
Write to files Read lines, search inside lines Read bytes.. Create files for reading and/or writing
listfiles = os.listdir(InputFolder)
for fileNames in listfiles: print fileNames MyList.write(fileNames + "\n") print finished listing files
Read entire file into a single string: S = input.read() Read next line:
output .write(S) Write all line strings L into file: output.writelines(L) Manual close of file: output .close()
for fc in fcs:
# set the output name for each feature class to be the same as the input output = outputWS + "\\" + fc[0:18] + ".txt" # get the count of each intersection file if count>0 then export to ASCII count =gp.GetCount_management(fc)
else:
print output + "count for rainfall radar cells value = " + count + "nothing to export ) print " the script will proceed to the next file " file3.write( output + "\ t" + "Count = 0" + "\n " )