Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Kernel Density calculates the density of features in a neighborhood around those features. It can be
calculated for both point and line features.
Possible uses include finding density of houses, crime reports or density of roads or utility lines influencing a
town or wildlife habitat. The population field could be used to weigh some features more heavily than others,
depending on their meaning, or to allow one point to represent several observations. For example, one
address might represent a condominium with six units, or some crimes might be weighed more severely
than others in determining overall crime levels. For line features a divided highway probably has more
impact than a narrow dirt road and a high-tension line has more impact than a standard electric pole.
Conceptually, a smoothly curved surface is fitted over each point. The surface value is highest at the
location of the point and diminishes with increasing distance from the point, reaching zero at the Search
radius distance from the point. Only a circular neighborhood is possible. The volume under the surface
equals the Population field value for the point, or one if NONE is specified. The density at each output raster
cell is calculated by adding the values of all the kernel surfaces where they overlay the raster cell center.
The kernel function is based on the quadratic kernel function described in Silverman (1986, p. 76, equation
4.5).
If a population field setting other than NONE is used, each item's value determines the number of times to
count the point. For example, a value of three would cause the point to be counted as three points. The
values can be integer or floating point.
By default a unit is selected based on the linear unit of the projection definition of the input point feature
data or as otherwise specified in the output coordinate system geoprocessing environment setting. If an
area unit is selected, the calculated density for the cell is multiplied by the appropriate factor before it is
written to the output raster.
For example, if the input units are meters, the output area units will default to square kilometers.
Comparing a unit scale factor of meters to kilometers will result in the values being different by a multiplier
of 1,000,000 (1,000 meters x 1,000 meters).
Increasing the radius will not greatly change the calculated density values. Although more points will fall
inside the larger neighborhood, this number will be divided by a larger area when calculating density. The
main effect of a larger radius is that density is calculated considering a larger number of points, which can
be further from the raster cell. This results in a more generalized output raster.
Conceptually, a smoothly curved surface is fitted over each line. Its value is greatest on the line and
diminishes as you move away from the line, reaching zero at the search radius from the line. The surface is
defined so the volume under the surface equals the product of line length and the Population field value. The
density at each output raster cell is calculated by adding the values of all the kernel surfaces where they
overlay the raster cell center. The use of the kernel function for lines is adapted from the quadratic kernel
function for point densities as described in Silverman (1986, p. 76, equation 4.5).
Kernel Density
Calculates a magnitude per unit area from point or polyline features using a kernel function to fit a smoothly
tapered surface to each point or polyline.
Learn more about how Kernel Density works
Usage tips
Command line and Scripting
• Only the points or portions of a line that fall within the neighborhood are considered in calculating
density. If no points or line sections fall within the neighborhood of a particular cell, that cell is
assigned NoData.
• Larger values of the radius parameter produce a smoother, more generalized density raster.
Smaller values produce a raster that shows more detail.
• If the area unit scale factor units are small relative to the features (distance between points or
length of line sections, depending on feature type), the output values may be small. To obtain
larger values, select the area unit scale factor for larger units (for example, square kilometers
versus square meters).
o Raster Storage: See the Raster Storage settings for the particular output raster format
selected.
ArcObjects
• Only the points or portions of a line that fall within the neighborhood are considered in calculating
density. If no points or line sections fall within the neighborhood of a particular cell, that cell is
assigned NoData.
• Larger values of the radius parameter produce a smoother, more generalized density raster.
Smaller values produce a raster that shows more detail.
• Density values calculated in the default units (length per square map unit) may be small. If the
output raster appears to have all zero or small values, use a larger unit_scale_factor.
Syntax
KernelDensity_sa (in_features, population_field, out_raster, cell_size, search_radius,
area_unit_scale_factor)
Output cell size (Optional) This is the value in the environment if specifically Analysis cell size
set. If the environment is not set, then cell size is
the shortest of the width or height of the extent of
in_features in the output spatial reference, divided
by 250.
• SQUARE_CENTIMETERS — for
centimeters.
Script Example
# KernelDensity_sample.py
# Description:
# Requirements: None
# Author: ESRI
import arcgisscripting
gp = arcgisscripting.create()
try:
outRaster = "C:/data/final_1"
inShp = "C:/data/pts.shp"
gp.CheckOutExtension("Spatial")
# Process: Kernel Density...
except:
print gp.GetMessages()
ArcObjects syntax
IDensityOp:KernelDensity (sourceFeatures as IGeoDataset, [radiusDistance], [scaleFactor]] As IGeoDataset
Parameter Explanation
The factor used to convert the map unit of the input dataset
to different units. The default value is one. For point source
data, the density will be in units of number of points per one
[scaleFactor]
square map unit. For line source data, density will be in units
of length of line per one square map unit. Output raster
values are multiplied by the square of this factor.
ArcObjects example
'
' Call the Kernel Density method with radius distance = 20 and a scale
factor of 5
See Also
Line Density
Point Density
Specify the coordinate system that will be used for processing and set to the output geodataset. The
coordinate system (geographic coordinate system or projected coordinate system) defines the location of
the spatial data on the earth.
If the geoprocessing tool has an input feature class, and the coordinate system environment is not set, the
coordinate system of the input* will be used as the processing and set as the output feature class'
coordinate system. To override this, set the "Coordinate System environment" to the desired coordinate
system.
* For tools which have multiple inputs (intersect for example) the coordinate of the first feature class in the
list will be used.
Usage tips
• When the coordinate system environment is different than the input feature class' coordinate
system, the input features are projected to the output coordinate system during tool execution. This
projecting of the features will not affect the input feature class. Keep in mind that a projection can
only be done between two known coordinate systems. So if either the input or output dataset's
coordinate system is unknown, no projection occurs. Then the input feature's coordinates are
assumed to be in the same coordinate system as the processing and output coordinate system.
• The keyword used at the command line or in scripts for this environment setting is
OutputCoordinateSystem.
• If not explicitly set and the output does not reside inside a feature dataset, the coordinate system of
the first input will be used.
• The coordinate system (geographic or projected) defines the location of the spatial data on the
earth.
OutputCoordinateSystem <outputCoordinateSystem>
Scripting syntax
An overview of scripting in geoprocessing
OutputCoordinateSystem (outputCoordinateSystem)
Script example
import arcgisscripting
gp = arcgisscripting.create()
gp.workspace = "h:/workspace"
Output extent
Defined area of interest for results from running tools. In the case of feature data, all input features to a tool
that pass through the area of interest will be included in the calculation. For raster data, results from
running tools will be contained within the extent set.
The extent is a rectangle, specified by identifying the coordinates of the window in map space.
Usage tips
• The keyword used at the command line or in scripts for this environment setting is: Extent.
• Set this environment if your study area is only a portion of a larger dataset.
• The extent entered are assumed to be in the coordinate system in which the data is stored, even if
the OutputCoordinateSystem environment is set.
• Extent uses keywords at the command line or in scripting. If you set extent using the environments
dialog you will notice the keywords are represented with phrases.
Intersection of The minimum area common to all inputs; where all layers overlay.
MINOF
Inputs This is the default.
MAXOF Union of Inputs The maximum extent of all inputs; the combined extent of all inputs.
value As specified below User specified XMin, YMin, XMax, YMax values.
The maximum extent of all inputs; the combined extent of all inputs.
N/A Default
NOTE: This option is available only on the environments dialog.
• When you first specify the extent to be the same as a layer, the extent is read and set. The next
time you open up environments, it will read "As specified below". The numbers come from the
previously set layer, but the option reverts to "as specified below".
In ModelBuilder
• In ModelBuilder, Extent will also show a list of variables. If you create a feature dataset, raster
dataset, feature layer, raster layer, or extent variables in your model you will see these as options
in the extent drop-down list. These choices are easily recognizable because they appear as either
"Same as variable <name>" or "Same as layer <name>".
• The list will also show derived data in the drop down list. Derived data does not already exist before
the model is executed and therefore can't be selected as the model extent. So if you are setting the
extent for the entire model do not select derived data.
• You can selected derived data only if you are setting the extent for a single process and the derived
data will be created before the process will execute. In your model diagram you will see a condition
connector line appear that forces the model to first execute the process with the derived data
element.
• In ArcGIS 9.2, extent is dynamic which allows for the additional selection of feature dataset, raster
dataset, feature layer, raster layer, or extent variables. However, if you open the extent
environment and click anywhere in the top/bottom/left/right input boxes the input will display As
specified below and the extent will become static. The variable you had selected will no longer
define the extent and the connector line will be automatically removed from your model. To make
the extent dynamic again you will need to re-set the extent by selecting a drop-down list choice.
o Right—XMax value
o Bottom—YMin value
o Top—YMax value
Extent MINOF
Scripting syntax
An overview of scripting in geoprocessing
Extent (study_area)
o Right—XMax value
o Bottom—YMin value
o Top—YMax value
Script example
import arcgisscripting
gp = arcgisscripting.create()
gp.workspace = "h:/workspace"
gp.toolbox = "SA"
gp.Extent = "MAXOF"
The raster storage settings section of the Environment Settings dialog box provides settings for raster
dataset results. Included are the following settings that can be changed: the default compression type, the
default settings for pyramid creation and calculating statistics, and the tile size used when loading raster
data to an existing raster dataset.
Not all settings apply to all storage types. Refer to the Raster storage matrix (below) for more details. File
Group 2 consist of the following file formats: BSB, BMP, DEM, ECW, GIF, JPEG, JPEG2000, MAP, PIX, PNG,
and XPM. All remaining ArcGIS supported raster file formats fall into File Group 1.
Raster storage matrix Storage File Group File Group personal File
ArcSDE
settings 1 2 GDB GDB
NOTE: Compression is dependant on the type of file format. Please refer to the Technical Specifications to
see which file formats are able to support compression.
The following subtopics supplement the reference topics found in Environment settings.
Compression type
The compression type setting is used by any tool whose output is a raster dataset. Three types of
compression are supported: LZ77, JPEG, and JPEG2000.
LZ77 (the default) is a lossless compression that preserves all raster cell values. It uses the same
compression algorithm as the PNG image format and one similar to ZIP compression. As you can rely on the
pixels not changing their values after you compress them, use LZ77 for performing visual or algorithmic
analysis.
JPEG is a lossy compression, because raster cell values may not be preserved after compression and
decompression. It uses the public domain JPEG (JFIF) compression algorithm and only works for unsigned 8-
bit raster data (single-band grayscale or three-band raster data).
JPEG2000 uses wavelet technology to compress rasters, so they visually appear lossless, meaning that
although the cell values do get manipulated, the differences between the original and the same raster with
compression are not easily distinguishable. Use JPEG or JPEG2000 for rasters that are meant as pictures or
backdrop imagery.
If JPEG or JPEG2000 is selected, you can also set the compression quality to control how much loss the
image will be subjected to by the compression algorithm. The values of the pixels of an image compressed
with a higher compression quality will be closer to those of the original image. Valid value ranges of
compression quality for JPEG are from five to 95. Valid value ranges for JPEG 2000 are from 1 to 100. The
default compression quality is 75. The amount of compression will depend on the data and compression
quality. The more homogeneous the data, the higher the compression ratio. The lower the compression
quality, the higher the compression ratio. Lossy compression normally results in higher compression ratios
when compared to lossless compression.
The primary benefits of compressing data are that compressed data requires less storage space and data
display times will be quicker, as there is less information to transmit.
Pyramids
pyramid are reduced-resolution representations of your dataset. They can speed up display of raster
datasets by retrieving only the data that is necessary at a specified resolution.
By default, pyramids are created for raster datasets by resampling the original data. There are three
resampling methods available: nearest neighbor, bilinear, and cubic.
The default is nearest neighbor. It works for any type of raster dataset. Use nearest neighbor for nominal
data or raster datasets with colormaps, such as land use data, scanned maps, and pseudocolor images.
Use bilinear interpolation or cubic convolution for continuous data, such as satellite imagery or aerial
photography.
If you uncheck Build pyramids, pyramids will not be created with the output raster. Not building pyramids
saves storage space but will lead to slower display speeds, especially for larger raster datasets.
Statistics
The Statistics option enables you to build statistics for output raster datasets. Statistics are required for your
raster dataset to perform certain tasks in ArcMap or ArcCatalog, such as applying a contrast stretch or
classifying your data. It is not essential to build statistics if they have not already been calculated, since
they are calculated the first time they are needed. However, it is recommended that you calculate statistics
for your raster datasets before using them if you want to use certain features that require statistics. The
default display of your raster will be improved in most cases if statistics have already been calculated,
because a standard deviation stretch is applied if statistics are present.
Setting a Skip factor allows you to speed up the process of calculating statistics by skipping pixels. The Skip
factor does not apply for GRID datasets.
Values you set to ignore will not participate in the statistics calculation. Normally, you may want to ignore
the values of the background. This only applies to personal geodatabase raster datasets.
Tile size
The tile size setting is used by any tools that create raster datasets and are stored in blocks.
The default tile size is 128 by 128, which is good for most cases. However, if the tile size is too big, you will
end up bringing up more data than is needed each time you access the data. For example, you want to
display a window of 100 by 100 and it only covers one tile. If you set the tile size to 512, you need to get
the tile of 512 by 512 pixels. If your tile size is set to 128 by 128, you'll bring up less extra data if the
display window is 100 by 100.
See Also
Snap raster
Snap raster is used to snap or align an extent during execution. The lower-left corner of the extent is
snapped to a cell corner of the snap raster and then the upper-right corner is adjusted using the output cell
size. As a result, when the output cell size is same as the snap raster cell size, the cells in the output raster
are aligned with the cells of the snap raster.
Learn more about how Snap Raster works
Usage tips
• In general, the snap raster is applied to tools that output a raster. The extent is not snapped when
the output is a feature class, or a table, or a file.
• Snap raster can be used with default output extent. You do not need to specify an extent explicitly
in environment to use snap raster.
• It is recommended to use the same cell size for snap and output raster. However, it is possible to
have the snap raster cell size different from the output raster cell size. In that case, only the left
and bottom boundaries will align with snap raster cells and the upper-right corner of the output
extent may not coincide with a cell corner of the snap raster.
• Specifying snap raster does not change the values in output extent control immediately, however,
the extent is adjusted during execution.
• The keyword used at the command line or in scripts for this environment setting is: SnapRaster.
• Snap raster specified as part of extent at the command line or in scripts will continue to work in
ArcGIS 9.3 but it is recommended to use the new separate snap raster setting.
• Since the extent could be snapped to a larger extent, the output raster may contain an additional
row and/or column of NoData cells.
• The size (i.e. the number of rows or columns) in a snap raster is not important. The origin and the
cell size are used to adjust the output extent.
• The extent of the snap raster does not need to be overlapped with the output extent. Therefore, a
small raster, located outside of your analysis area could be used for snapping.
• The keyword used at the command line or in scripts for this environment setting is: SnapRaster.
SnapRaster <raster_dataset>
<raster_dataset> The raster dataset to be used as the snap raster. Raster Dataset
Scripting syntax
An overview of scripting in geoprocessing
SnapRaster raster_dataset
raster_dataset (Required) The raster dataset to be used as the snap raster. Raster Dataset
Script example
import arcgisscripting
gp = arcgisscripting.create()
gp.workspace = "C:/workspace"
gp.extent = "C:/data/projectbnd"
gp.SnapRaster = "C:/data/mysnapraster"
try:
InRaster = "C:/data/dem"
OutRaster = "C:/data/aspect"
gp.CheckOutExtension("Spatial")
# Process: Aspect
gp.Aspect_sa(InRaster, OutRaster)
except:
print gp.GetMessages()
See Also
Current workspace
Specifies the workspace for the current session. The location from which inputs are taken and outputs are
placed when running tools.
Usage tips
• The keyword used at the command line or in scripts for this environment setting is Workspace.
• As a general rule, multiple users should not simultaneously access the same workspace or the same
INFO directory.
• You can only edit one collection of dataset (one workspace) at a time. These can be geodatabase,
ArcInfo coverage, or shapefile.
• Explicitly stating the current workspace will allow you to specify only the name of datasets used
without the path to their location.
<workspace or feature The location from which inputs are taken and outputs are Folder |
dataset> placed when running tools. Workspace
workspace d:\myWorkspace
OR
workspace d:\myWorkspace.mdb
Scripting syntax
An overview of scripting in geoprocessing
If the geoprocessing tool has an input feature class, and the coordinate system environment is not set, the
coordinate system of the input* will be used as the processing and set as the output feature class'
coordinate system. To override this, set the "Coordinate System environment" to the desired coordinate
system.
* For tools which have multiple inputs (intersect for example) the coordinate of the first feature class in the
list will be used.
Usage tips
• When the coordinate system environment is different than the input feature class' coordinate
system, the input features are projected to the output coordinate system during tool execution. This
projecting of the features will not affect the input feature class. Keep in mind that a projection can
only be done between two known coordinate systems. So if either the input or output dataset's
coordinate system is unknown, no projection occurs. Then the input feature's coordinates are
assumed to be in the same coordinate system as the processing and output coordinate system.
• The keyword used at the command line or in scripts for this environment setting is
OutputCoordinateSystem.
• If not explicitly set and the output does not reside inside a feature dataset, the coordinate system of
the first input will be used.
• The coordinate system (geographic or projected) defines the location of the spatial data on the
earth.
OutputCoordinateSystem <outputCoordinateSystem>
Scripting syntax
An overview of scripting in geoprocessing
OutputCoordinateSystem (outputCoordinateSystem)
Script example
import arcgisscripting
gp = arcgisscripting.create()
gp.workspace = "h:/workspace"
gp.OutputCoordinateSystem = "Coordinate Systems\Projected Coordinate
Systems\Utm\Nad 1983\NAD 1983 UTM Zone 22N.prj"
See Also
scratch workspace
current workspace
xy tolerance
XY Tolerance
NOTE: In ArcGIS 9.2, the term xy tolerance has been introduced. This term is synonymous with cluster
tolerance. In certain contexts the term cluster tolerance has been replaced by the term XY Tolerance.
Specify the XY Tolerance that will be used for processing and set to the output geodataset.
Usage tips
• If the output is a feature class inside a feature dataset and the XY tolerance of the feature dataset is
used, the environment will be ignored.
• If the output is a standalone feature class, raster catalog or feature dataset, the tolerance of the
input will be used as the processing tolerance and set as the output geodataset's XY tolerance. For
tools that have multiple inputs (Intersect for example) the tolerance of the first input in the list will
be used as the default. To override these defaults, set the XY tolerance environment to the desired
value.
• For tools that do not have an input geodataset (for example, Create Feature Class, Create Feature
Dataset, and Create Raster Catalog) and if the environment is left blank, the default XY tolerance is
set to 0.001 meters or its equivalent in map units. For example, if your coordinate system is
recorded in feet, the default value is 0.003281 feet (0.03937 inches). The default value is 10 * the
default XY resolution, and this is recommend for most cases. If coordinates are in latitude-
longitude, the default XY tolerance is 0.0000000556 degrees. To override this default, set the
environment to the desired value.
• If the tolerance value entered for the XY tolerance environment or parameter is in a different unit
than the output coordinate system, the equivalent distance measure in the center of the output
coordinate system is used for processing. This may not be desirable, especially when dealing with a
projected coordinate system and a angular unit of measurement (degrees, grads) or when dealing
with a geographic coordinate system and a linear unit of measurement (feet, meters).
• If the XY tolerance is set to "Unknown" units, the units are assumed to be the same as the output
coordinate system's units.
• The XY tolerance is not intended to be used to generalize geometry shapes. Instead, it's intended to
integrate line work and boundaries during topological operations. That means integrating
coordinates that fall within very small distances of one another. Because coordinates can move in
both X and Y by as much as the XY tolerance, many potential problems can be resolved by
processing datasets with commands that use the XY tolerance. These include handling of extremely
small overshoots or undershoots, automatic sliver removal of duplicate segments, and coordinate
thinning along boundary lines.
• To keep movement small, keep the XY tolerance small. However, an XY tolerance that is too small
(such as 2 * XY resolution or less) may not properly integrate the line work of shared boundaries.
• Conversely, if your XY tolerance is too large, feature coordinates may collapse on one another. This
can compromise the accuracy of feature boundary representations.
• Your XY tolerance should never approach your data capture resolution. For example, at a map scale
of 1:12,000, one inch equals 1,000 feet, and 1/50 of an inch still equals 20 feet— a data capture
accuracy that would be hard to meet during digitizing and scan conversion. You'll want to keep the
coordinate movement using the XY tolerance well under these numbers. Remember, the default XY
Tolerance in this case would be 0.003281 feet.
• If the XY tolerance is not at least twice as large as the XY resolution value, the XY tolerance is set to
be twice as large as the XY resolution by default.
<Linear You can set the value to be higher for data that has less coordinate
Linear Unit
unit> accuracy and lower for datasets with extremely high accuracy.
Scripting syntax
An overview of scripting in geoprocessing
Linear unit You can set the value to be higher for data that has less coordinate
Linear Unit
(Required) accuracy and lower for datasets with extremely high accuracy.
Script example
import arcgisscripting
gp = arcgisscripting.create()
gp.workspace = "h:/workspace"
gp.XYTolerance = "0.02"