GPX To Features (Conversion)

Summary

Converts the point data in a .gpx file to features.

Usage

  • The tool converts the point data in a .gpx file to features. A .gpx file stores points as waypoints or tracks. Waypoints are generally single unrelated points, while tracks consist of a route or collection of related points with a start and end point. The type of point collected is specified in the output Type field by the values WPT (waypoint) or TRKPT (track point). Waypoints can have a name and description for each individual point. Tracks have a name and description associated with the track, not for each individual point.

  • If Points is chosen for the Output Type parameter, the output features will include the geometry (including elevation or z-value) as well as following attribute fields:

    • Name
    • Descript
    • Type
    • Comment
    • Symbol
    • Elevation
    • DateTimeS—A string data type.
    • DateTime—A date data type. Shapefiles do not support date field types that contain both date and time; they only support the date (no time). Output shapefiles will only have a DateTimeS field. All other output format types will attempt to create a DateTime field as long as the date format conforms to the XML Time standard. Most .
      gpx
      files follow the XML Time standard. For more information about shapefiles and their limitations, see Geoprocessing considerations for shapefile output.

  • If Tracks as polylines is chosen for the Output Type parameter, the tool will create output polyline features from track points (TRKPT) in the input .gpx file. Unique tracks will be created based on the Name field. Output features will include the geometry (including elevation or z-value) as well as the following attribute fields:

    • Name
    • Descript
    • Type
  • Output points or polylines will be created in the WGS84 coordinate system. The output features can be reprojected to another coordinate system using the Project tool.

  • Both the 1.0 and 1.1 Topografix GPX schemas are supported. Files that do not conform to one of these schemas will not translate.

  • You can convert point feature classes to .gpx files with the Features To GPX tool. Alternatively, the ArcGIS Data Interoperability extension can create GPX output.

Parameters

LabelExplanationData Type
Input GPX File

The input .gpx file to be converted.

File
Output Feature class

The output point feature class.

Feature Class
Output Type
(Optional)

Specifies the geometry type of the output feature class.

  • PointsAn output point feature class will be created. All GPX points will be included in the output. This is the default.
  • Tracks as polylinesAn output polyline feature class will be created. Only GPX track points will be included in the output.
String

arcpy.conversion.GPXtoFeatures(Input_GPX_File, Output_Feature_class, {Output_Type})
NameExplanationData Type
Input_GPX_File

The input .gpx file to be converted.

File
Output_Feature_class

The output point feature class.

Feature Class
Output_Type
(Optional)

Specifies the geometry type of the output feature class.

  • POINTSAn output point feature class will be created. All GPX points will be included in the output. This is the default.
  • TRACKS_AS_LINESAn output polyline feature class will be created. Only GPX track points will be included in the output.
String

Code sample

GPXToFeatures example 1 (Python window)

The following Python snippet converts a .gpx file to features from the Python window.

import arcpy

arcpy.conversion.GPXtoFeatures('c:\\GPX_Files\\Hike.gpx', 'c:\\gisData\\Hike.shp', 'POINTS')