Skip to content

Commit

Permalink
#2 #6 Work in progress:
Browse files Browse the repository at this point in the history
-Move test files
-Create example files
-Update README

[ci skip]
  • Loading branch information
FABallemand committed Jul 16, 2023
1 parent 7d99776 commit d96952c
Show file tree
Hide file tree
Showing 22 changed files with 67 additions and 2 deletions.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,33 @@ pip install ezgpx
```python
import ezgpx

test_gpx = ezgpx.GPX("file.gpx")
test_gpx.plot(start_stop=True, elevation_color=True)
# Parse GPX file
gpx = ezgpx.GPX("file.gpx")

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

# Plot with Matplotlib
gpx.matplotlib_plot(title="Track", base_color="#FF0000",
start_stop=True, way_points=False, file_path="img_1")

# Plot with Matplotlib Basemap Toolkit
gpx.matplotlib_basemap_plot(title="Track", base_color="#00FF00",
start_stop=False, way_points=False, file_path="img_2")

# Plot with gmap (Google Maps)
gpx.gmap_plot(title="Track", base_color="#0000FF", start_stop=True,
way_points=True, file_path="map_1.html", open=True)

# Plot with Folium
gpx.folium_plot(title="Track", tiles="OpenStreetMap", base_color="#000000", start_stop=True,
way_points=True, minimap=True, coord_popup=True, file_path="map_2.html", open=True)

# Remove metadata
gpx.remove_metadata()

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

## 📚 References:
Expand Down
23 changes: 23 additions & 0 deletions examples/plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import ezgpx

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

# Plot with Matplotlib
gpx.matplotlib_plot(title="Track", base_color="#FF0000",
start_stop=True, way_points=False, file_path="img_1")

# Plot with Matplotlib Basemap Toolkit
gpx.matplotlib_basemap_plot(title="Track", base_color="#00FF00",
start_stop=False, way_points=False, file_path="img_2")

# Plot with gmap (Google Maps)
gpx.gmap_plot(title="Track", base_color="#0000FF", start_stop=True,
way_points=True, file_path="map_1.html", open=True)

# Plot with Folium
gpx.folium_plot(title="Track", tiles="OpenStreetMap", base_color="#000000", start_stop=True,
way_points=True, minimap=True, coord_popup=True, file_path="map_2.html", open=True)

# Write new GPX file
gpx.to_gpx("new_file.gpx")
7 changes: 7 additions & 0 deletions examples/read_write.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ezgpx

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

# Write new GPX file
gpx.to_gpx("new_file.gpx")
10 changes: 10 additions & 0 deletions examples/simplify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import ezgpx

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

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

# Write new simplified GPX file
gpx.to_gpx("new_file.gpx")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d96952c

Please sign in to comment.