GPX To Features (Conversion)

License Level:BasicStandardAdvanced

Summary

Converts GPX files into features.

Usage

Syntax

GPXToFeatures_conversion (Input_GPX_File, Output_Feature_class)
ParameterExplanationData Type
Input_GPX_File

The GPX file to convert.

File
Output_Feature_class

The feature class to create.

Feature Class

Code Sample

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')

Environments

This tool does not use any geoprocessing environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
10/24/2012