| Label | Explanation | Data Type |
Input GPX File
| The input .gpx file that will be converted. | File |
Output Feature class
| The output point or polyline feature class. | Feature Class |
Output Type
(Optional) | Specifies the geometry type of the output feature class that will be created.
| String |
Summary
Converts the point data in a .gpx file to features.
Usage
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 the Output Type parameter is set to Points, the output features will include the geometry (including elevation or z-value) as well as the 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 the Output Type parameter is set to Tracks as polylines, 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
By default, output points or polylines will be created in the WGS84 coordinate system. When the Output Coordinate System environment is set, the output feature class will be reprojected to this coordinate system from the Coordinate System parameter value.
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 using the Features To GPX tool. Alternatively, use the ArcGIS Data Interoperability extension to create GPX output.
Parameters
arcpy.conversion.GPXtoFeatures(Input_GPX_File, Output_Feature_class, {Output_Type})| Name | Explanation | Data Type |
Input_GPX_File | The input .gpx file that will be converted. | File |
Output_Feature_class | The output point or polyline feature class. | Feature Class |
Output_Type (Optional) | Specifies the geometry type of the output feature class that will be created.
| String |
Code sample
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')Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes