Calculate Density uses input point features to calculate a density map within an area of interest. Calculate Density uses a Kernel density calculation to create a density surface from point features.
Example
Bird counts can be used to calculate species densities. The densities can then be compared to land-cover data to determine the habitats each species prefers.
Run Calculate Density
Calculate Density can be run on maps with point layers.
Complete the following steps to calculate density:
- Click the map card to activate it if necessary.
A card is active when the toolbar and Action button appear.
- Click the Action button and choose Calculate Density.
- For Choose a point layer, select the layer to use to calculate density.
- Expand Additional options and provide values for the Weight, Search radius (bandwidth), and Cell size parameters if necessary.
See the Usage notes section below for more information.
- Click Run.
Usage notes
Use the Choose a point layer parameter to select a dataset to calculate densities. Only point features are available in the drop-down menu.
Expand Additional options to access the Weight, Search radius (bandwidth), and Cell size parameters. The following table summarizes these parameters, including their default values:
Parameter | Description | Default value |
---|---|---|
Weight | A field denoting the value of each feature. For example, if you have a dataset for retail locations that includes a field for revenue, you can use the revenue field as the weight to create a density surface based on sales amount rather than locations. | All features are weighted as 1 (that is, the density surface is based solely on the location of the features). |
Search radius (bandwidth) | A distance (in miles, feet, kilometers, or meters) that is used to find input features within the same neighborhood as the focal feature. | An appropriate search distance is calculated for the input dataset using Silverman's Rule-of-thumb formula. |
Cell size | The size of the output features that create the density surface. | An appropriate cell size is calculated for the input dataset based on the extent of the dataset and number of features. |
The result dataset is styled by Counts and amounts (Color) using a default equal interval classification with 10 classes.
Use the Flip card button to view information on the back of the card, including the values for the search radius and bandwidth.
Limitations
The input dataset must be point features.
Cross filters are not compatible with result datasets created by this tool. To add a cross filter to an unsupported card, copy the dataset to your workbook and apply a cross filter to the cards created with the copy.
This tool is not supported for read-only connections to Google BigQuery, Snowflake, and database platforms that are not supported out of the box.
How Calculate Density works
Calculate Density uses a Kernel density calculation to create a density surface. The following sections explain the Kernel density calculation, as well as the default calculations for Search radius (bandwidth) and Cell size.
Kernel density
Kernel density calculates the density of features within a circular neighborhood surrounding each output cell using a Gaussian function. Conceptually, a smooth 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 when the distance from the point equals the search distance.
The numbers in the following table correspond to the numbers in the image above:
Number | Description |
---|---|
One of the points in the dataset | |
A distance equal to the search radius (bandwidth) |
Each surface also includes volume. The volume for the surface is equal to the Weight parameter value for each feature, or 1 if no value is specified. The weight determines how many times a point is counted in the density formula.
The density for each cell is calculated by adding the values of all the kernel surfaces where they overlay the output cell center. The kernel function is based on the Quartic kernel function described in Silverman (1986, 76).
The following formula is used to calculate density at (x,y) location:
where:
- ρ = The density at (x,y) location.
- r = The search radius (bandwidth).
- i = 1, ..., n input points. Only points within the search radius of the (x,y) location are included.
- W_{i} = The weight of point i. If a weight field is not specified, the weight will be 1 for all points.
- d_{i} = The distance between point i and the (x,y) location. The distance must be less than the search radius.
Search radius (bandwidth)
The default search radius applies an algorithm to the data based on both the extent of the data and the density of the points. The Search radius (bandwidth) parameter appears blank because the default radius is not calculated until the analysis begins. When you leave the Search radius (bandwidth) parameter blank, the default radius is applied.
If you prefer to specify a different search radius, consider that the larger the search radius, the more generalized the pattern. A smaller search radius shows more local variation but may miss the broader picture.
Cell size
If no cell size is provided, the cell size is calculated based on formulas described in Hengl (2006). The formulas are dataset dependent and are determined based on the number of features and the extent or scale of the input dataset to optimize both performance and output resolution.
Distance calculations
You can run Calculate Density using either a projected coordinate system (projected data) or a geographic coordinate system (nonprojected data). When projected data is used, a Euclidean distance (a straight-line distance measured on a flat surface) is calculated. When nonprojected data is used, a geodesic distance (a line drawn on a sphere representing the curvature of the earth) is calculated. The geodesic distance calculation is based on Haversine's formula.
References
Silverman, B. W. 1986. Density Estimation for Statistics and Data Analysis. Monographs on Statistics and Applied Probability. New York: Springer.
Hengl, Tomislav. 2006. "Finding the right pixel size." Computers & Geosciences, 32, no. 9 (November): 1283-1298. https://doi.org/10.1016/j.cageo.2005.11.008
Resources
Use the following resources to learn more: