Summary
Latitude and longitude are geographic coordinates used to specify a location on the Earth’s surface, which allows for precise positioning and navigation. In ArcGIS Pro, the Calculate Geometry Attributes tool is used to calculate the latitude and longitude values of a specific feature geometry by populating the coordinate fields in the attribute table. This method is applicable to line segments at regular intervals, making it useful for traffic analysis, determining the distribution of amenities along the road, or calculating distances between specific locations. This article provides the workflow to calculate the latitude and longitude of line segments at regular intervals in ArcGIS Pro.
Procedure
- Open the project in ArcGIS Pro.
- Create point features at regular intervals along the line feature using the Generate Points Along Lines tool.
- On the Analysis tab, in the Geoprocessing group, click Tools.
- In the Geoprocessing pane, search for and click Generate Points Along Lines (Data Management Tools).
- In the Generate Points Along Lines pane, for Input Features, select the line feature layer from the drop-down list.
- For Output Feature Class, specify a location and name for the output feature class.
- For Distance, specify the interval of the point features and the unit. In this example, it is 500 meters.
- Click Run.
- Split the line feature based on its proximity to the point features using the Split Line at Point tool.
- On the Analysis tab, in the Geoprocessing group, click Tools.
- In the Geoprocessing pane, search for and click Split Line at Point (Data Management Tools).
- In the Split Line at Point pane, for Input Features, select the line feature layer from the drop-down list.
- For Point Features, select the output feature layer in Step 2 from the drop-down list.
- For Output Feature Class, specify a location and name for the output feature class.
- For Search Radius, specify the distance to split the line feature and the unit. In this example, it is 5 meters.
- Click Run.
Note:
Alternatively, divide the line feature into the desired number of line segments using the Divide tool in the Modify Feature pane. Refer to ArcGIS Pro: Divide a polyline by a value for more information.
- Calculate the latitude and longitude of each line segment using the Calculate Geometry Attributes tool.
- On the Analysis tab, in the Geoprocessing group, click Tools.
- In the Geoprocessing pane, search for and click Calculate Geometry Attributes (Data Management Tools).
- In the Calculate Geometry Attributes pane, for Input Features, select the output feature layer in Step 3 from the drop-down list.
- For Field (Existing or New) under Geometry Attributes, select the latitude and longitude fields from the drop-down list. For Property, select Line start y-coordinate for the latitude field and Line start x-coordinate for the longitude field from the drop-down list.
- For Coordinate Format, specify the preferred coordinate format to calculate the XY coordinates of the line segments. Refer to ArcGIS Pro: Parameters for more information.
- For Coordinate System, click Select coordinate system to open the Coordinate System window.
- In the Coordinate System window, expand Projected Coordinate System or Geographic Coordinate System to specify the coordinate system. In this example, WGS 1984 Web Mercator (auxiliary sphere) is selected. Click OK.
- Click Run.
Note:
Label the latitude and longitude values of each line segment on the map, if necessary. Refer to How To: Display labels from two or more fields in ArcGIS Pro for instructions.
The image below shows the latitude and longitude values for each line segment at 500-meter intervals in ArcGIS Pro.