âShow Table of Contents
The Distance tool calculates the ellipsoidal direct point-to-point, point-to-edge, or the drive distance between two sets of spatial objects.
There are three types of distance calculation relationships available.
- Point-to-point: The Distance tool calculates the distance between two sets of point type spatial objects. An example is calculating the distance from records in a customer file (point type) to records in a store file (point type).
- Point-to-edge (line): The Distance tool calculates the distance between a set of point type spatial objects and the closest edge of a set of line type spatial objects. An example is calculating the distance from the records in a customer file (point type) to the nearest interstate highway (edge of line spatial type).
- Point-to-edge (polygon ): The Distance tool calculates the distance between a set of point type spatial objects and the closest edge of a set of polygon type spatial objects.
- When the points are contained within the polygons, you can choose one of two options: Return a distance of zero, or Return the distance to the nearest edge. If the point is located inside of a polygon the Distance tool will return a negative number for the distance to the edge of the containing polygon.
- When the points are contained outside of the polygons, you can also choose to have the Distance tool calculate the Nearest Interior point within the nearest edge of a polygon.
- While this method of calculating distance takes the curvature of the Earth into consideration, it is not a routing routine and does not follow street patterns or honor physical barriers such as bodies of water.
- Choose the Spatial Object Fields to calculate the distance between. The Source MUST be a point or the centroid of a polygon.
The Destination field can be any type of spatial object: point, line, polyline or polygon.
TIP:To optimize the process for speed, the spatial object selected in the Destination(right side) should be the larger spatial object (physically larger), while the object selected in theSource(left side) should be the smaller file (less records).
- Output Distance Checkbox. When checked, the calculated distance will be outputted in an appended data field.
- Create the Nearest Interior Point Inside of the Polygon. Checking this box will add a spatial point object to the data stream. It is the distance between the specified Source and this newly created Point that is returned.
- Select the appropriate radio button to specify the preferred behavior of what to do if a point is within a polygon. Choices include: Return a value of 0 or Return the distance of the nearest edge.
- Output Drivetime & Distance to Destination Centroid checkbox. When checked, the drivetime in minutes from source to destination will be calculated.
- Choose the dataset to use in calculating the drivetime and drive distance. If you only have one dataset installed, you will not have the option to select another dataset.
You can specify the default dataset from User Settings. Go to Options > User Settings > Edit User Settings and click the Dataset Defaults tab.
- Select the method for your route to be optimized. Choices include:
Allow Reversed Routing for Optimum Speed: When checked, the engine will try to determine if you have significantly more "Source" points than "Destination" points, and if so, it will reverse the two. This will result in somewhat different drivetimes (because of one-way streets), but can yield enormous performance improvements.
- Time: This is the default route. This method finds the route based on the least amount of time between points. When this method is selected, both drivetime and drive distance are returned.
- Distance:This method ignores road speeds to find the most direct route between points. When this method is selected, drive distance is returned. Drivetime is not returned because road speeds were all set to be the same to calculate the most direct route.
Drivetime is only available if you have the Drivetime engine installed.
Notice the Output Cardinal Direction checkbox. When checked, the direction (N, NE, SW, etc.) will be outputted in an appended data field.
Notice the Output Direction in Degrees checkbox. When checked, the distance direction in degrees will be outputted in an appended data field.
In the Units section, click either Miles, Kilometers, Meters, or Feet to specify the unit of measure.
The two sets of spatial objects that you specify in the Source and the Destination boxes must be contained within the same data stream or input. You can do this using Alteryxâs other tools "upstream" from the Distance tool in the engine. See the samples.
Â©2017 Alteryx, Inc., all rights reserved. AllocateÂ®, AlteryxÂ®, GuzzlerÂ®, and SolocastÂ® are registered trademarks of Alteryx, Inc.