Raster Processing in Arcgis 10
Raster Processing in Arcgis 10
Best Practices
IMAGERY
Raster Formats
ArcGIS 10 supports 69 different raster types ArcGIS 9.3.1 supported 37 raster types All supported formats are made possible through the Geospatial Data
Image Compression
New compression types for TIFF file format.
Packbits (Lossless) CCITT Group 3 (Lossless) CCITT Group 4 (Lossless) CCITT (1D) (Lossless)
Automatic Processing
Clip Mask Orthorectify Pan sharpening Mosaic NDVI Composite Bands Shaded Relief
functions.
Does not have to contain continuous images. Can be disjointed sets of
Server.
Boundary Layer
Footprint Layer
Image Layer
Examples of metadata added MinPS MaxPS Acquisition Date Cloud Cover Sun Azimuth Sun Elevation Sensor Name etc. Metadata has to match the standards of those provided
by the imagery vendor or the metadata and imagery will fail to load
Example: Raster Mosaic Dataset will not accept Landsat imagery
from MontanaView.
default fields
ObjectID Raster Name MinPS MaxPS LowPS HighPS Category Tag GroupName CenterX CenterY ZOrder SOrder
each band.
Colors can be excluded using the
when you export the raster as a layer file or a supported raster dataset.
Classification
Training Sample Manager to aid in
Geoprocessing
Most of the new raster geoprocessing tools belong to the
Split Raster
Split rasters in the X & Y direction via two methods Size of Tile (based on pixels or mapping units) Number of Tiles Does not split attribute tables. Various output formats TIFF ENVI GRID Imagine JPEG PNG
in a workspace
Can also scan rasters in a subdirectory All raster formats are supported In Arc10 build pyramids is enabled by default when
can work with a specified subset of bands within a mosaic dataset. (ESRI)
To make the layer permanent Save as Layer
Raster to DTED
DTED > Digital Terrain Elevation Data (NGA developed) Primarily used in the Military for various purposes Input raster will be a single band raster with elevation data Three different levels DTED Level 0 (1 kilometer) DTED Level 1 (~100 meters) DTED Level 2 (30 meters) Nationwide DTED Level 0 is available for public use
allows you to apply your newly created color scheme to your rasters.
DEMO
Image Analysis Window Raster Mosaic Dataset
PYTHON
An introduction to the new ArcPy Site Package including Python 2.6
INTRO TO ARCPY
ArcPy
The new ArcPy Site Package Fits Python Framework Builds on the arcgisscripting module Begin all scripts with import arcpy Difference between 9.3.1 & 10 Replace gp. with arcpy.
gp.CopyFeatures_management(input, output) arcpy.CopyFeatures_management(input, output)
>>> help(arcpy)
Definition
ArcGIS 10 introduces ArcPy (often referred to as the ArcPy site-package), which provides Python access for all geoprocessing tools, including extensions, as well as a wide variety of useful functions and classes for working with and interrogating GIS data. A site-package is Python's term for a library that adds additional functions to Python. Using Python and ArcPy, you can develop an infinite number of useful programs that operate on geographic data.
ArcPy modules
A module is a python file that generally includes functions and classes. ArcPy is supported by a series of modules, including a mapping module (arcpy.mapping), a Spatial Analyst module (arcpy.sa), and a Geostatistical Analyst module (arcpy.ga). A class is analogous to an architectural blueprint. The blueprint provides the framework for how to create something. Classes can be used to create objects, often referred to as an instance. ArcPy classes, such as the SpatialReference and Extent classes, are often used as shortcuts to complete geoprocessing tool parameters that would otherwise have a more complicated string equivalent. A function is a defined bit of functionality that does a specific task and can be incorporated into a larger program. In ArcPy all geoprocessing tools are provided as functions, but not all functions are geoprocessing tools. In addition to tools, ArcPy provides a number of functions to better support geoprocessing Python workflows. Functions or methods can be used to list certain datasets, retrieve a dataset's properties, validate a table name before adding it to a geodatabase, or perform many other useful scripting tasks.
ArcPy classes
ArcPy functions
Source: ESRI
Classes
Extent Point
Function
Search Cursor ListRasters Describe
Python 2.6
New Modules Multiprocessing Module Allows for spawning multiple processes Sidesteps Global Interpreter Lock Important for HPC Python 2.6 Updates 259 Patches 612 Bugs Fixed
Source: Whats New in Python 2.6
ArcPy
Once ArcPy is imported you have access to all of the
standard toolboxes
Analysis Cartography Conversion Data Management Editing Geocoding Linear Referencing Multidimension Spatial Statistics
MODULES
ArcPy
Similar to other Python packages you have modules ArcPy Modules
Mapping Module Spatial Analyst Module Geostatistical Analyst Module
Mapping Module
Open Map Documents and Layers Alter the Contents of the Document or Layer Print the Modified Document Export the Modified Document Save the Modified Document Module uses Functions and Classes Example:
import arcpy mxd = arcpy.mapping.MapDocument('c:/pnw/annualdischarge.mxd') arcpy.mapping.ExportToJPEG(mxd,'c:/temp/annualdischarge.jpg') del mxd
Geostatistical Analyst
Used for defining parameters for Geostatistical Analyst
FUNCTIONALITY
For Loop
Old Arc 9.3 Syntax RasterList = gp.ListRasters(): Rasters = RasterList.next() while Rasters: print Rasters Rasters = RasterList.next()
While Loop
Calculate Field
New Python Syntax-Math.sin() Uses Math, String, Datetime Python Modules Use the !HydroID!
arcpy.CalculateField_management("kamfloodplains","linelen","math.sin(!linelen! )","PYTHON")
Geometry operators
Python geometry objects support relational operators Contains Crosses Disjoint Equals Overlaps Touches Within
from arcpy import * p1 = Polygon(Array(([Point(1,5),Point(2,4),Point(6,5)]))) p2 = Polygon(Array(([Point(3,5),Point(6,4),Point(8,5)]))) p1.overlaps(p2) True
Python Window
All Python functionality right within ArcMap No need to write Python Scripts Can also incorporate other Python Packages Intellisense for ArcPy and other Python Packages
Operators (Map Algebra) Arithmetic Bitwise Boolean Relational Addition Adding two rasters together Functions Apply Environment - Creates a new raster that is a copy of the input raster with the current
environment settings being applied.
Spatial Analyst
Proper Import Syntax from arcpy.sa import * This syntax allows all module contents to be imported No need to add syntax for the toolbox Example
from arcpy.sa import * Plus(dem, 54)
Map Algebra
Map Algebra has been integrated into Python. Can be accessed through 3 environments Raster Calculator Python Window Python Integrated Development Environment (IDE) More complex Map Algebra expression are better suited
for either the Python Window in ArcMap or a Python IDE (such as PythonWin or IDLE).
Raster Calculator performs the same as previous versions. No longer necessary to specify output raster in expression. Example: raster = Expression Tool variable available to specify the output raster and type.
NumPy - RastertoNumpyArray
Useful for raster computation Why? Computers are meant for number crunching Possibilities NDVI, Resample, Selection Important Factors for NumPy Integration Lower Left Corner of the Raster The Number of Rows The Number of Columns No Data Value Limits: Has Array Size Limits based on RAM Alaska DEM 39383 Rows, 49563 Column 4GB
NumPy - RastertoNumpyArray
NumPy - NumpyArraytoRaster
NumPy - NumpyArraytoRaster
Initial Raster
Altered Raster
DEMO
ArcPy Demo Python Window
THANKS!!!!
If you would like a copy of this