The Summarize Nearby task finds features that are within a specified distance of features in the input layer. Distance can be measured as a straight-line distance or by a specified travel mode. Statistics are then calculated for the nearby features.
For example, using Summarize Nearby, you could:
- Calculate the total population within five minutes of driving time of a proposed new store location.
- Calculate the number of freeway access ramps within a one-mile driving distance of a proposed new store location to use as a measure of store accessibility.
Licensing
As described in the Get started with the Spatial Analysis service topic, in order for you to use any analysis task, the administrator of the organization must grant you certain basic privileges. To summarize nearby features using one of the available travel modes, you must also be granted the Network Analysis privilege.
Request URL
http://<analysis url>/SummarizeNearby/submitJob
Limits
There are limits to number of features and distance when nearType is set to a travel mode other than "StraightLine".
- sumNearbyLayer—Maximum 1,000 features
- distance—Maximum 300 minutes or 482.80 kilometers (300 miles)
- An error will occur if the tool takes more than 60 minutes to run when using travel modes. If this error occurs, rerun the analysis with fewer input features.
Request parameters
Parameter | Description | |
---|---|---|
sumNearbyLayer (Required) | Point, line, or polygon features from which distances will be measured to features in the summaryLayer. Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:
Examples:
| |
summaryLayer (Required) | Point, line, or polygon features. Features in this layer that are within the specified distance to features in the sumNearbyLayer will be summarized. Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:
Examples:
| |
nearType | Defines what type of distance measurement you want to use: straight-line distance, or by measuring travel time or travel distance along a street network using various modes of transportation known as travel modes. The default is StraightLine. Valid values are a string, StraightLine, which indicates Euclidean distance will be used as the distance measure, or a JSON object representing settings for a travel mode. Travel modes are managed in ArcGIS Online and can be configured by the administrator of your organization to better reflect your organization's workflows. You must specify the JSON object containing the settings for a travel mode supported by your organization. To get a list of supported travel modes, run the GetTravelModes operation from the Utilities service. When using a travel mode for the nearType parameter, use a JSON object representing travel mode settings for the value. When you use the GetTravelModes operation from the Utilities service, the result is a string representing the travel mode JSON object. You must convert this string to a valid JSON object using the API and pass the JSON object as the value for the nearType parameter. For example, the following is a string representing the Walking Time travel mode as returned by the GetTravelModes operation:
Convert the value above to a valid JSON object and pass it as the value for the nearType parameter. nearType=
Example:
| |
distances (Required) | A list of double values that defines the search distance (for StraightLine and distance-based travel modes) or time (for time-based travel modes). You can enter a single distance value or multiple values, separating each value with a space. Features that are within (or equal to) the distances you enter will be summarized. The units of the distance values are supplied by the units parameter. Examples:
| |
units | If nearType is StraightLine or a distance-based travel mode, this is the linear unit to be used with the distance values specified in distances. Values: Meters | Kilometers | Feet | Yards | Miles If nearType is a time-based travel mode, the following values can be used as units: Values: Seconds | Minutes | Hours The default is Meters Example:
| |
timeOfDay | Specify whether travel times should consider traffic conditions. To use traffic in the analysis, set nearType to a travel mode object whose impedanceAttributeName property is set to TravelTime and assign a value to timeOfDay. (A travel mode with other impedanceAttributeName values doesn't support traffic.) The timeOfDay value represents the time at which travel begins, or departs, from the input points. The time is specified as Unix time (milliseconds since midnight, January 1, 1970). The service supports two types of traffic: typical and live. Typical traffic references travel speeds that are made up of historical averages for each five-minute interval spanning a week. Live traffic retrieves speeds from a traffic feed that processes phone probe records, sensors, and other data sources to record actual travel speeds and predict speeds for the near future. The Data Coverage page shows the countries Esri currently provides traffic data for. Typical Traffic: To ensure the task uses typical traffic in locations where it is available, choose a time and day of the week, and then convert the day of the week to one of the following dates from 1990:
Set the time and date as Unix time in milliseconds. For example, to solve for 1:03 p.m. on Thursdays, set the time and date to 1:03 p.m., 4 January 1990, and convert to milliseconds (631458180000). Note:Although the dates representing days of the week are from 1990, typical traffic is calculated from recent traffic trends—usually over the last several months. Live Traffic: To use live traffic when and where it is available, choose a time and date and convert to Unix time. Esri saves live traffic data for 4 hours and references predictive data extending 4 hours into the future. If the time and date you specify for this parameter is outside the 8-hour time window, or the travel time in the analysis continues past the predictive data window, the task falls back to typical traffic speeds. Note:
Syntax: The number of milliseconds since the Unix epoch (January 1, 1970). Examples:
| |
timeZoneForTimeOfDay | Specify the time zone or zones of the timeOfDay parameter. There are two options: GeoLocal (default) and UTC. GeoLocal: The timeOfDay value refers to the time zone or zones in which the input points are located. This option causes the analysis to have rolling start times across time zones. GeoLocal illustration: Setting timeOfDay to 9:00 a.m., 4 January 1990 (631443600000 milliseconds) and timeZoneForTimeOfDay to GeoLocal and submitting a valid request causes the drive times for points in the Eastern Time Zone to start at 9:00 a.m. Eastern Time and 9:00 a.m. Central Time for points in the Central Time Zone. (The start times are offset by an hour in real or UTC time.) UTC: The timeOfDay value refers to Coordinated Universal Time (UTC). The start times for all points are simultaneous, regardless of time zones. UTC illustration: Setting timeOfDay to 9:00 a.m., 4 January 1990 (631443600000 milliseconds), and timeZoneForTimeOfDay to UTC, the start time for points in the Eastern Time Zone is 4:00 a.m. Eastern Time and 3:00 a.m. Central Time for those in the Central Time Zone. Values: GeoLocal | UTC | |
returnBoundaries | If true, the resultLayer will contain areas defined by the specified nearType. For example, if using a StraightLine value of 5 miles, the resultLayer will contain areas with a 5-mile radius around the input sumNearbyLayer features. If false, the resultLayer will contain the same features as the sumNearbyLayerlayer. The default is true. Values: true | false | |
sumShape | A Boolean value that instructs the task to calculate statistics based on shape type of the summaryLayer, such as the count of points, the total length of lines, or the total area of polygons of the summaryLayer within each polygon in the sumNearbyLayer. If the summaryLayer is lines or polygons, the count of features within each summary polygon is returned. The default is true. Values: true | false If sumShape is set to false, at least one value for summaryFields must be provided. Note:If either minorityMajorityor percentShapeis set to true, the summarized geometry is returned in the output regardless of the value of the sumShape parameter. | |
shapeUnits (Required if sumShape is true) | If sumShape is true, you must specify the units of the shape summary. Values:
| |
summaryFields (Required if sumShape is false) | A list of field names and statistical summary types that you want to calculate for all nearby features. Syntax: ["fieldName summaryType","fieldName summaryType", ...] fieldName is the name of one of the numeric fields found in the summaryLayer. summaryType is one of the following:
Example:
Note:Mean and Std. Deviation are calculated using weighted mean and weighted standard deviation for line and polygon features. Statistics are calculated using only the proportion of the lines or polygons that are within the boundary of the summary polygon. None of the statistics for point features are weighted. | |
groupByField | This is a field of the summaryLayer features that you can use to calculate statistics separately for each unique attribute value. For example, suppose the summaryLayer contains point locations of businesses that store hazardous materials, and one of the fields is HazardClass, which contains codes that describe the type of hazardous material stored. To calculate summaries by each unique value of HazardClass, use HazardClass as the groupByField field. Example:
When a groupByField field is provided, two results are created: the result layer and a related groupBySummary table containing the statistics. | |
minorityMajority | This Boolean parameter is applicable only when a groupByField is specified. If true, the minority (least dominant) or the majority (most dominant) attribute values for each group field within each nearby area are calculated. Two new fields are added to the resultLayer prefixed with Majority_ and Minority_. The default is false. Values: true | false | |
percentShape | This Boolean parameter is applicable only when a groupByField is specified. If set to true, the percentage of each unique groupByField value is calculated for each sumNearbyLayer feature. The default is false. Values: true | false | |
outputName | If provided, the task will create a feature service of the results. You define the name of the service. If an outputName value is not provided, the task will return a feature collection. Syntax: Syntax: | |
context | The Context parameter contains the following additional settings that affect task operation:
Syntax:
| |
f | The response format. The default response format is html. Values: html | json |
Response
When you submit a request, the service assigns a unique job ID for the transaction.
{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}
After the initial
request is submitted you can use the
jobId to periodically check the status of the job and messages as described in the topic Checking job status.
Once the job has successfully completed, you use
the jobId to retrieve the results. To track the status, you can make a request of the following form:http://<analysis url>/SummarizeNearby/jobs/<jobId>
Accessing results
When the status of the job request is esriJobSucceded, you can access the results of the analysis by making a request of the following form.
http://<analysis url>/SummarizeNearby/jobs/<jobId>/results/<output parameter name>?token=<your token>&f=json
Parameter | Description |
---|---|
resultLayer |
The result has properties for parameter name, data type, and value. The contents of value depend on the outputName parameter provided in the initial request.
See Feature Output for more information about how the result layer or collection is accessed. |
groupBySummary | If a groupByField field was provided as input, the result will have a groupBySummary table that contains the calculated statistics for each unique group. Tables are a subset of features; that is, they contain
attributes but no geometry. The result has properties for parameter name, data type, and value. The contents of value depend on the outputName parameter provided in the initial request.
See Feature Output for more information about how the result layer or collection is accessed. |