root/MGET/Branches/Jason/PythonPackage/dist/TracOnlineDocumentation/Documentation/ArcGISReference/ArcGISRaster.ProjectClipAndOrExecuteMapAlgebra.html @ 842

Revision 842, 22.8 KB (checked in by jjr8, 19 months ago)

Rebuilt installation packages again. This will be merged with the Trunk and released as MGET 0.8a28.

Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="81help.css?format=raw" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Project, Clip, and/or Execute Map Algebra</title></head><body><table style="margin-top:-1em; margin-bottom:0; padding:0; margin-left:-1em"><tr><td style="background:white"><img width="875" height="70" alt="ArcToolbox banner" src="AHBanner_ArcToolbox.gif?format=raw" /></td></tr></table><h1>Project, Clip, and/or Execute Map Algebra</h1><p></p><p>Projects, clips, and/or perfoms map algebra on an ArcGIS raster. You must request at least one of these three operations. If you request multiple operations, the tool performs them in the order they are listed.</p><br /><p><h2><img width="11" height="11" border="0" src="sm_arrow_down.gif?format=raw" /> Command line syntax</h2></p><div Class="expand" id="id103142">ArcGISRasterProjectClipAndOrExecuteMapAlgebra_GeoEco &lt;inputRaster&gt; &lt;outputRaster&gt; {projectedCoordinateSystem} {geographicTransformation} {NEAREST | BILINEAR | CUBIC} {projectedCellSize} {registrationPoint} {clippingDataset} {clippingRectangle} {mapAlgebraExpression} {buildPyramids} <br /><br /><b>Parameters</b><br /><table width="100%" border="0" cellpadding="5"><tbody><tr><th width="40%"><b>Expression</b></th><th width="60%"><b>Explanation</b></th></tr><tr><td class="info">&lt;inputRaster&gt;</td><td class="info" align="left"><p>Input raster.</p></td></tr><tr><td class="info">&lt;outputRaster&gt;</td><td class="info" align="left"><p>Output raster.</p><p>If this path refers to the file system, missing directories in the
4path will be created if they do not exist.</p></td></tr><tr><td class="info">{projectedCoordinateSystem}</td><td class="info" align="left"><p>New coordinate system to project the raster to.</p><p>The raster may only be projected to a new coordinate system if the
5original projection is defined. An error will be raised if you specify
6a new coordinate system without defining the original coordinate
7system.</p><p>The ArcGIS Project Raster tool is used to perform the projection. The
8documentation for that tool recommends that you also specify a cell
9size for the new coordinate system.</p><p>I have noticed that for certain coordinate systems the ArcGIS 9.2
10Project Raster tool seems to clip the projected raster to an arbitrary
11extent that is too small. For example, when projecting a global MODIS
12Aqua 4 km chlorophyll image in geographic coordinates to
13Lambert_Azimuthal_Equal_Area with central meridian of -60 and latitude
14of origin of -63, the resulting image is clipped to show only
15one-quarter of the planet. This problem does not occur when Project
16Raster is invoked interactively from the ArcGIS user interface; it
17only occurs when the tool is invoked programmatically (the
18ProjectRaster_management method of the geoprocessor). Thus you may
19not see it when you use Project Raster yourself but it may happen when
20you use MGET tools that invoke Project Raster as part of their
21geoprocessing operations.</p><p>If you encounter this problem, you can work around it like this:</p><ul><li><p>First, run this tool without specifying a new coordinate system, to
22obtain the raster in the original coordinate system.</p></li></ul><ul><li><p>In ArcCatalog, use the Project Raster tool to project the raster to
23the new coordinate system. Verify that the entire raster is present,
24that it has not been clipped to an extent that is too small.</p></li></ul><ul><li><p>In ArcCatalog, look up the extent of the projected raster by
25right-clicking on it in the catalog tree, selecting Properties, and
26scrolling down to Extent.</p></li></ul><ul><li><p>Now, before running the MGET tool that projects the raster, set the
27Extent environment setting to the values you looked up. If you are
28invoking the MGET tool interactively from ArcCatalog or ArcMap,
29click the Environments button on the tool's dialog box, open General
30Settings, change the Extent drop-down to "As Specified Below", and
31type in the values you looked up. If you're invoking it from a
32geoprocessing model, right-click on the tool in the model, select
33Make Variable, From Environment, General Settings, Extent. This will
34place Extent as a variable in your model, attached to the MGET tool.
35Open the Extent variable, change it to "As Specified Below" and type
36in the values you looked up. If you're invoking the MGET tool
37programmatically, you must set the Extent property of the
38geoprocessor to the values you looked up. Please see the ArcGIS
39documentation for more information about this and Environment
40settings in general.</p></li></ul><ul><li><p>Run the MGET tool. The extent of the raster should now be the
41proper size.</p></li></ul></td></tr><tr><td class="info">{geographicTransformation}</td><td class="info" align="left"><p>A transformation method used to convert between the original
42coordinate system and the new coordinate system.</p><p>This parameter is a new option introduced by ArcGIS 9.2. You must have
43ArcGIS 9.2 to use this parameter.</p><p>This parameter is only needed when you specify that the raster should
44be projected to a new coordinate system and that new system uses a
45different datum than the original coordinate system, or there is some
46other difference between the two coordinate systems that requires a
47transformation. To determine if a transformation is needed, I
48recommend the following procedure:</p><ul><li><p>First, run this tool without specifying a new coordinate system, to
49obtain the raster in the original coordinate system.</p></li></ul><ul><li><p>Next, use the ArcGIS 9.2 Project Raster tool on the raster to
50project it to the desired coordinate system. If a geographic
51transformation is needed, that tool will prompt you for one. Write
52down the exact name of the transformation you used.</p></li></ul><ul><li><p>Finally, if a transformation was needed, type in the exact name into
53this tool, rerun it, and verify that the raster was projected as you
54desired.</p></li></ul></td></tr><tr><td class="info">{NEAREST | BILINEAR | CUBIC}</td><td class="info" align="left"><p>The resampling algorithm to be used to project the original raster
55to a new coordinate system. The ArcGIS Project Raster tool is used to
56perform the projection and accepts the following values:</p><ul><li><p>NEAREST - nearest neighbor interpolation</p></li></ul><ul><li><p>BILINEAR - bilinear interpolation</p></li></ul><ul><li><p>CUBIC - cubic convolution</p></li></ul><p>You must specify one of these algorithms to project to a new
57coordinate system. An error will be raised if you specify a new
58coordinate system without selecting an algorithm.</p></td></tr><tr><td class="info">{projectedCellSize}</td><td class="info" align="left"><p>The cell size of the projected coordinate system. Although this
59parameter is optional, to receive the best results, the ArcGIS
60documentation recommends you always specify it when projecting to a
61new coordinate system.</p></td></tr><tr><td class="info">{registrationPoint}</td><td class="info" align="left"><p>The x and y coordinates (in the output space) used for pixel
62alignment.</p><p>This parameter is a new option introduced by ArcGIS 9.2. You must have
63ArcGIS 9.2 to use this parameter. It is ignored if you do not specify
64that the raster should be projected to a new coordinate system.</p></td></tr><tr><td class="info">{clippingDataset}</td><td class="info" align="left"><p>Existing feature class, raster, or other geographic dataset having
65the extent to which the raster should be clipped.</p><p>WARNING: If you use this tool from in an ArcGIS geoprocessing model
66and you select a dataset by clicking the folder icon and browsing to
67the dataset, your selection may mysteriously disappear from this text
68box after you close the tool. This is a bug in ArcGIS. To work around
69it, drag and drop the desired dataset into the model. This will create
70a layer in the model for that dataset. Then select that layer in this
71tool by clicking the drop-down box rather than clicking the folder
72icon. The selected layer should not disappear when you close the
73tool.</p></td></tr><tr><td class="info">{clippingRectangle}</td><td class="info" align="left"><p>Rectangle to which the raster should be clipped.</p><p>If a projected coordinate system was specified, the clipping is
74performed after the projection and the rectangle's coordinates should
75be specified in the new coordinate system. If no projected coordinate
76system was specified, the coordinates should be specified in the
77original coordinate system.</p><p>The ArcGIS Clip tool is used to perfom the clip. The clipping
78rectangle must be passed to this tool as a string of four numbers
79separated by spaces. The ArcGIS user interface automatically formats
80the string properly; when invoking this tool from the ArcGIS UI,
81you need not worry about the format. But when invoking it
82programmatically, take care to provide a properly-formatted string.
83The numbers are ordered LEFT, BOTTOM, RIGHT, TOP. For example, if the
84raster is in a geographic coordinate system, it may be clipped to 10
85W, 15 S, 20 E, and 25 N with the string:</p><dl><dt></dt><dd><p>10 15 20 25</p></dd></dl><p>Integers or decimal numbers may be provided.</p></td></tr><tr><td class="info">{mapAlgebraExpression}</td><td class="info" align="left"><p>Map algebra expression to execute on the raster.</p><p><b>WARNING:</b> The ArcGIS Geoprocessing Model Builder may randomly and
86silently delete the value of this parameter. This is a bug in ArcGIS.
87Before running a model that you have saved, open this tool and
88validate that the parameter value still exists.</p><p>The expression is executed after the converted raster is projected and
89clipped (if those options are specified). Use the case-sensitive
90string inputRaster to represent the raster that you now want to
91perform map algebra upon. For example, to convert the raster to an
92integer raster and add 1 to all of the cells, use this expression:</p><dl><dt></dt><dd><pre>int(inputRaster) + 1</pre></dd></dl><p>The string inputRaster is case-sensitive. Prior to executing the map
93algebra expression, the string is replaced with the path to a
94temporary raster that represents the raster being generated. The final
95expression must be less than 4000 characters long or ArcGIS will
96report an error.</p><p>The ArcGIS Single Output Map Algebra tool is used to execute the map
97algebra expression. You must have a license for the ArcGIS Spatial
98Analyst extension in order to perform map algebra.</p><p>Map algebra syntax can be very picky. Here are some tips that will
99help you succeed with this tool:</p><ul><li><p>Before using this tool, construct and test out your map algebra
100expression using the ArcGIS Single Output Map Algebra tool. Then
101paste the expression into this tool and edit it to use the
102inputRaster variable rather than the test value you used with Single
103Output Map Algebra.</p></li></ul><ul><li><p>If you do develop your expression directly in this tool, start with
104a very simple expression. Verify that it works properly, add a
105little to it, and verify again. Repeat this process until you have
106built up the complete expression.</p></li></ul><ul><li><p>Always separate mathematical operators from raster paths using
107spaces. In the example above, the / operator contains a space on
108either side. Follow this pattern. In some circumstances, ArcGIS will
109fail to process raster algebra expressions that do not separate
110raster paths from operators using spaces. The reported error message
111usually does not indicate that this is the problem, and tracking it
112down can be very frustrating.</p></li></ul></td></tr><tr><td class="info">{buildPyramids}</td><td class="info" align="left"><p>If True, pyramids will be built for the raster, which will improve
113its display speed in the ArcGIS user interface.</p></td></tr></tbody></table></div><p><h2><img width="11" height="11" border="0" src="sm_arrow_down.gif?format=raw" /> Scripting syntax</h2></p><div Class="expand" id="TEST">ArcGISRasterProjectClipAndOrExecuteMapAlgebra_GeoEco (inputRaster, outputRaster, projectedCoordinateSystem, geographicTransformation, resamplingTechnique, projectedCellSize, registrationPoint, clippingDataset, clippingRectangle, mapAlgebraExpression, buildPyramids) <br /><br /><b>Parameters</b><br /><table width="100%" border="0" cellpadding="5"><tbody><tr><th width="40%"><b>Expression</b></th><th width="60%"><b>Explanation</b></th></tr><tr><td class="info">Input raster (Required) </td><td class="info" align="left"><p>Input raster.</p></td></tr><tr><td class="info">Output raster (Required) </td><td class="info" align="left"><p>Output raster.</p><p>If this path refers to the file system, missing directories in the
114path will be created if they do not exist.</p></td></tr><tr><td class="info">Project to new coordinate system (Optional) </td><td class="info" align="left"><p>New coordinate system to project the raster to.</p><p>The raster may only be projected to a new coordinate system if the
115original projection is defined. An error will be raised if you specify
116a new coordinate system without defining the original coordinate
117system.</p><p>The ArcGIS Project Raster tool is used to perform the projection. The
118documentation for that tool recommends that you also specify a cell
119size for the new coordinate system.</p><p>I have noticed that for certain coordinate systems the ArcGIS 9.2
120Project Raster tool seems to clip the projected raster to an arbitrary
121extent that is too small. For example, when projecting a global MODIS
122Aqua 4 km chlorophyll image in geographic coordinates to
123Lambert_Azimuthal_Equal_Area with central meridian of -60 and latitude
124of origin of -63, the resulting image is clipped to show only
125one-quarter of the planet. This problem does not occur when Project
126Raster is invoked interactively from the ArcGIS user interface; it
127only occurs when the tool is invoked programmatically (the
128ProjectRaster_management method of the geoprocessor). Thus you may
129not see it when you use Project Raster yourself but it may happen when
130you use MGET tools that invoke Project Raster as part of their
131geoprocessing operations.</p><p>If you encounter this problem, you can work around it like this:</p><ul><li><p>First, run this tool without specifying a new coordinate system, to
132obtain the raster in the original coordinate system.</p></li></ul><ul><li><p>In ArcCatalog, use the Project Raster tool to project the raster to
133the new coordinate system. Verify that the entire raster is present,
134that it has not been clipped to an extent that is too small.</p></li></ul><ul><li><p>In ArcCatalog, look up the extent of the projected raster by
135right-clicking on it in the catalog tree, selecting Properties, and
136scrolling down to Extent.</p></li></ul><ul><li><p>Now, before running the MGET tool that projects the raster, set the
137Extent environment setting to the values you looked up. If you are
138invoking the MGET tool interactively from ArcCatalog or ArcMap,
139click the Environments button on the tool's dialog box, open General
140Settings, change the Extent drop-down to "As Specified Below", and
141type in the values you looked up. If you're invoking it from a
142geoprocessing model, right-click on the tool in the model, select
143Make Variable, From Environment, General Settings, Extent. This will
144place Extent as a variable in your model, attached to the MGET tool.
145Open the Extent variable, change it to "As Specified Below" and type
146in the values you looked up. If you're invoking the MGET tool
147programmatically, you must set the Extent property of the
148geoprocessor to the values you looked up. Please see the ArcGIS
149documentation for more information about this and Environment
150settings in general.</p></li></ul><ul><li><p>Run the MGET tool. The extent of the raster should now be the
151proper size.</p></li></ul></td></tr><tr><td class="info">Geographic transformation (Optional) </td><td class="info" align="left"><p>A transformation method used to convert between the original
152coordinate system and the new coordinate system.</p><p>This parameter is a new option introduced by ArcGIS 9.2. You must have
153ArcGIS 9.2 to use this parameter.</p><p>This parameter is only needed when you specify that the raster should
154be projected to a new coordinate system and that new system uses a
155different datum than the original coordinate system, or there is some
156other difference between the two coordinate systems that requires a
157transformation. To determine if a transformation is needed, I
158recommend the following procedure:</p><ul><li><p>First, run this tool without specifying a new coordinate system, to
159obtain the raster in the original coordinate system.</p></li></ul><ul><li><p>Next, use the ArcGIS 9.2 Project Raster tool on the raster to
160project it to the desired coordinate system. If a geographic
161transformation is needed, that tool will prompt you for one. Write
162down the exact name of the transformation you used.</p></li></ul><ul><li><p>Finally, if a transformation was needed, type in the exact name into
163this tool, rerun it, and verify that the raster was projected as you
164desired.</p></li></ul></td></tr><tr><td class="info">Projection resampling technique (Optional) </td><td class="info" align="left"><p>The resampling algorithm to be used to project the original raster
165to a new coordinate system. The ArcGIS Project Raster tool is used to
166perform the projection and accepts the following values:</p><ul><li><p>NEAREST - nearest neighbor interpolation</p></li></ul><ul><li><p>BILINEAR - bilinear interpolation</p></li></ul><ul><li><p>CUBIC - cubic convolution</p></li></ul><p>You must specify one of these algorithms to project to a new
167coordinate system. An error will be raised if you specify a new
168coordinate system without selecting an algorithm.</p></td></tr><tr><td class="info">Cell size for projected coordinate system (Optional) </td><td class="info" align="left"><p>The cell size of the projected coordinate system. Although this
169parameter is optional, to receive the best results, the ArcGIS
170documentation recommends you always specify it when projecting to a
171new coordinate system.</p></td></tr><tr><td class="info">Registration point for projected coordinate system (Optional) </td><td class="info" align="left"><p>The x and y coordinates (in the output space) used for pixel
172alignment.</p><p>This parameter is a new option introduced by ArcGIS 9.2. You must have
173ArcGIS 9.2 to use this parameter. It is ignored if you do not specify
174that the raster should be projected to a new coordinate system.</p></td></tr><tr><td class="info">Clip to extent of geographic dataset (Optional) </td><td class="info" align="left"><p>Existing feature class, raster, or other geographic dataset having
175the extent to which the raster should be clipped.</p><p>WARNING: If you use this tool from in an ArcGIS geoprocessing model
176and you select a dataset by clicking the folder icon and browsing to
177the dataset, your selection may mysteriously disappear from this text
178box after you close the tool. This is a bug in ArcGIS. To work around
179it, drag and drop the desired dataset into the model. This will create
180a layer in the model for that dataset. Then select that layer in this
181tool by clicking the drop-down box rather than clicking the folder
182icon. The selected layer should not disappear when you close the
183tool.</p></td></tr><tr><td class="info">Clip to rectangle (Optional) </td><td class="info" align="left"><p>Rectangle to which the raster should be clipped.</p><p>If a projected coordinate system was specified, the clipping is
184performed after the projection and the rectangle's coordinates should
185be specified in the new coordinate system. If no projected coordinate
186system was specified, the coordinates should be specified in the
187original coordinate system.</p><p>The ArcGIS Clip tool is used to perfom the clip. The clipping
188rectangle must be passed to this tool as a string of four numbers
189separated by spaces. The ArcGIS user interface automatically formats
190the string properly; when invoking this tool from the ArcGIS UI,
191you need not worry about the format. But when invoking it
192programmatically, take care to provide a properly-formatted string.
193The numbers are ordered LEFT, BOTTOM, RIGHT, TOP. For example, if the
194raster is in a geographic coordinate system, it may be clipped to 10
195W, 15 S, 20 E, and 25 N with the string:</p><dl><dt></dt><dd><p>10 15 20 25</p></dd></dl><p>Integers or decimal numbers may be provided.</p></td></tr><tr><td class="info">Execute map algebra expression (Optional) </td><td class="info" align="left"><p>Map algebra expression to execute on the raster.</p><p><b>WARNING:</b> The ArcGIS Geoprocessing Model Builder may randomly and
196silently delete the value of this parameter. This is a bug in ArcGIS.
197Before running a model that you have saved, open this tool and
198validate that the parameter value still exists.</p><p>The expression is executed after the converted raster is projected and
199clipped (if those options are specified). Use the case-sensitive
200string inputRaster to represent the raster that you now want to
201perform map algebra upon. For example, to convert the raster to an
202integer raster and add 1 to all of the cells, use this expression:</p><dl><dt></dt><dd><pre>int(inputRaster) + 1</pre></dd></dl><p>The string inputRaster is case-sensitive. Prior to executing the map
203algebra expression, the string is replaced with the path to a
204temporary raster that represents the raster being generated. The final
205expression must be less than 4000 characters long or ArcGIS will
206report an error.</p><p>The ArcGIS Single Output Map Algebra tool is used to execute the map
207algebra expression. You must have a license for the ArcGIS Spatial
208Analyst extension in order to perform map algebra.</p><p>Map algebra syntax can be very picky. Here are some tips that will
209help you succeed with this tool:</p><ul><li><p>Before using this tool, construct and test out your map algebra
210expression using the ArcGIS Single Output Map Algebra tool. Then
211paste the expression into this tool and edit it to use the
212inputRaster variable rather than the test value you used with Single
213Output Map Algebra.</p></li></ul><ul><li><p>If you do develop your expression directly in this tool, start with
214a very simple expression. Verify that it works properly, add a
215little to it, and verify again. Repeat this process until you have
216built up the complete expression.</p></li></ul><ul><li><p>Always separate mathematical operators from raster paths using
217spaces. In the example above, the / operator contains a space on
218either side. Follow this pattern. In some circumstances, ArcGIS will
219fail to process raster algebra expressions that do not separate
220raster paths from operators using spaces. The reported error message
221usually does not indicate that this is the problem, and tracking it
222down can be very frustrating.</p></li></ul></td></tr><tr><td class="info">Build pyramids (Optional) </td><td class="info" align="left"><p>If True, pyramids will be built for the raster, which will improve
223its display speed in the ArcGIS user interface.</p></td></tr></tbody></table></div></body></html>
Note: See TracBrowser for help on using the browser.