# Visualizing Map Data with Go and Leaflet JS

DevFeed: [Visualizing Map Data with Go and Leaflet JS](<https://devfeed.tech/articles/visualizing-map-data-with-go-and-leaflet-js-22229.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2023/11/visualizing-map-data-go.html>)

Published: 2023-11-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [plotting](<https://devfeed.tech/topics/plotting.md>), [Data Management](<https://devfeed.tech/topics/data-management.md>), [JSON](<https://devfeed.tech/topics/json.md>)

Tags: [aggregate](<https://devfeed.tech/tags/aggregate.md>), [aggregation](<https://devfeed.tech/tags/aggregation.md>), [api](<https://devfeed.tech/tags/api.md>), [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [js](<https://devfeed.tech/tags/js.md>), [location](<https://devfeed.tech/tags/location.md>), [map](<https://devfeed.tech/tags/map.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [programming](<https://devfeed.tech/tags/programming.md>), [visualization](<https://devfeed.tech/tags/visualization.md>)

## AI overview

The article describes a Go service that accepts a GPX track and returns an interactive Leaflet JS map. A sample walk contains 2,600 location points, so the author aggregates points by minute to reduce clutter. For parsing, the article uses Go's standard library XML support and unmarshals only the GPX elements needed through a tagged local struct, then maps those values into a separate API struct. It recommends keeping GPX-specific XML tags out of exported API data structures to shield the API from changes in the source format. The excerpt ends as the data aggregation section begins, so it does not show the remaining implementation.

## Source excerpt

Introduction This year I set a personal goal of walking for a total of 1,000 kilometers and I'm proud to say I'm close to hitting that goal. I've been tracking all the different routes I take in an app named Strava. One nice feature of Strava is that the app provides access to the raw data in a format called GPX. Starva can visualize the route in their app, but I wanted to try and perform my own visualization. That brought me to this blog post about using Leaflet JS to plot one of my walks on a map.