GPX To Features

Title  GPX To Features

Summary

Geoprocessing tool to convert GPX files into feature classes.


Usage


Syntax

Parameter Explanation
Input_GPX_File

The GPX file to convert.

Output_Feature_class

The feature class to create.

Code Samples

GPXToFeatures Example 1 (Python Window)

The following Python snippet converts a GPX file into features from the Python window.


import arcpy

arcpy.GPXtoFeatures_conversion('c:\\GPX_Files\\Hike.gpx', 'c:\\gisData\\Hike.shp')

                    

GPXToFeatures Example 2 (stand-alone script)

The following Python snippet converts a GPX file into features and then selects the tracks and creates a polyline feature class of those unique tracks.


# Name: ConvertMultiTracks.py
# Description: Converts multiple tracks within a single GPX file into
#              individual line segments

# Import system models
import arcpy

# Convert the GPX file into in_memory features
arcpy.GPXtoFeatures_conversion('c:\\GPX_Files\\MultiHike.gpx', 'in_memory\hikes')

# Select only the track points
arcpy.SelectLayerByAttribute_management('in_memory\hikes', 'NEW_SELECTION', "\"Type\" = 'TRKPT'")

# Convert the tracks into lines. The 'Name' field creates unique tracks.
arcpy.PointsToLine_management('in_memory\hikes', 'c:\\output\HikeTracks.shp', 'Name', '#', 'NO_CLOSE')

                    

Tags

Credits

Use limitations