gemgis.vector.load_gpx_as_dict#

gemgis.vector.load_gpx_as_dict(path: str, layer: Union[int, str] = 'tracks') Collection#

Loading a GPX file as dict

Parameters
  • path (str) – Path to the GPX file, e.g. path='file.gpx'

  • layer (Union[int, str]) – The integer index or name of a layer in a multi-layer dataset, e.g. layer='tracks', default is tracks

Returns

gpx_dict – Dict containing the GPX data

Return type

dict

New in version 1.0.x.

Example

>>> # Loading Libraries and File
>>> import gemgis as gg
>>> gpx = gg.vector.load_gpx_as_dict(path='file.gpx', layer='tracks')
>>> gpx
{'type': 'Feature',
 'id': '0',
 'properties': OrderedDict([('name',
               'First half marathon distance of the year'),
              ('cmt', None),
              ('desc', None),
              ('src', None),
              ('link1_href', None),
              ('link1_text', None),
              ('link1_type', None),
              ('link2_href', None),
              ('link2_text', None),
              ('link2_type', None),
              ('number', None),
              ('type', '9')]),
 'geometry': {'type': 'MultiLineString',
  'coordinates': [[(8.496285, 52.705566),
    (8.49627, 52.705593),
    (8.496234, 52.705629),...]]}}

See also

load_gpx_as

Loading a GPX file as Collection

load_gpx_as_geometry

Loading a GPX file as Shapely BaseGeometry