Add rudimentary HTTP server for RideWithGPS routes.

This commit is contained in:
Ray Miller 2020-04-17 13:01:05 +01:00
parent f879acf25d
commit d1934a0e85
3 changed files with 96 additions and 8 deletions

View file

@ -1,8 +1,8 @@
package openname
import (
"io"
"math"
"os"
"strings"
"time"
@ -58,11 +58,7 @@ type TrackSummary struct {
PointsOfInterest []POI
}
func (gs *GPXSummarizer) SummarizeTrack(filename string) (*TrackSummary, error) {
r, err := os.Open(filename)
if err != nil {
return nil, err
}
func (gs *GPXSummarizer) SummarizeTrack(r io.Reader) (*TrackSummary, error) {
g, err := gpx.Read(r)
if err != nil {
return nil, err