Skip to content

FABallemand/ezGPX

Repository files navigation

🗺️ ezGPX

GitHub PyPI - Version GitHub last commit CI Documentation Status GitHub repo size PyPI - Downloads linting: pylint Imports: isort Code style: black

🔎 Description

ezGPX is an easy to use Python library for working with GPX files.

Read, modify, write, and extract insights from your activity data with ease!

🛠️ Installation

pip install ezgpx

🏁 Get started

import ezgpx
import matplotlib

# Parse GPX file
gpx = ezgpx.GPX("file.gpx")

# Plot using matplotlib
# See documentation and examples for more plotting methods!
plotter = ezgpx.MatplotlibPlotter(gpx)
plotter.plot(
    figsize=(16, 9),
    size=50,
    color="ele",
    cmap=matplotlib.cm.get_cmap("viridis", 12),
    colorbar=True,
    start_point_color="green",
    stop_point_color="red",
    way_points_color="blue",
    background="World_Imagery",
    title=gpx.name(),
    title_fontsize=30,
    file_path="matplotlib.png"
)

# Simplify (using Ramer-Dougle-Peucker algorithm)
gpx.simplify()

# Remove metadata
gpx.remove_metadata()

# Write new simplified GPX file
gpx.to_gpx("new_file.gpx")

Plot made with Matplotlib

👤 Author

  • Fabien ALLEMAND