Skip to content

Instantly share code, notes, and snippets.

@simonpoole
Created August 30, 2022 13:32
Show Gist options
  • Save simonpoole/4f8579b73f60ff8b4a972444638a5da1 to your computer and use it in GitHub Desktop.
Save simonpoole/4f8579b73f60ff8b4a972444638a5da1 to your computer and use it in GitHub Desktop.
Remove track points with 0 coordinates from a GPX file
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://www.topografix.com/GPX/1/1">
<xsl:template match="m:trkpt[@lon='0'][@lat='0']" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment