ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

GPX To Features

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Converts GPX files into features.

Usage

  • This tool converts the point information inside a GPX file into features. The output features will include the geometry (including elevation or Z-value) as well as attribute fields for Name, Description, Type, DateTimeS (string type), Elevation, and DateTime (date type - if possible). Shapefiles do not support Date-Time fields, they only support Date fields. Output shapefiles will only have a DateTime field of type string created. All other output format types will attempt to create a real DateTime field as long as the date format complies to the XML Time standard. Most GPX files follow the XML Time standard.

  • GPX files collect points in two ways: waypoints and tracks. Waypoints are generally single, unrelated points while tracks make up a route or collection of related points with a start and end point. The type of point collected is specified in the output feature class by the code WPT (waypoint) or TRKPT (track point) within the Type attribute field. Waypoints can have a name and description for each individual point. Tracks have a name and description associated with the track itself, not for each individual point.

    You can use the Points To Line tool to create polylines for each track.

    • Use the Select Layer By Attribute tool to select track points with the expression: TYPE = "TRKPT".
    • Use the selected features as input to the Points To Line tool. In the Line Field parameter of Points To Line tool, choose the Name field to create unique tracks.

    The Python code below shows how this workflow is accomplished using a script.

  • Output will be generated in the WGS84 coordinate system. The output features can be reprojected to another coordinate system, if desired, 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 create GPX files (the opposite output of this tool, GPX to Features) with a sample tool available from arcgis.com. Alternatively, the Data Interoperability Extension can create GPX output.

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

  • Current Workspace
  • Scratch Workspace

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics

  • An overview of the From GPS toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal