diff --git a/cmd/save-gob/main.go b/cmd/save-gob/main.go index f318730..76f6bb9 100644 --- a/cmd/save-gob/main.go +++ b/cmd/save-gob/main.go @@ -25,6 +25,7 @@ func main() { func(r *openname.Record) error { b := placenames.NamedBoundary{ Name: r.Name, + Type: r.LocalType, Xmin: r.MbrXMin, Ymin: r.MbrYMin, Xmax: r.MbrXMax, diff --git a/pkg/placenames/placenames.bin b/pkg/placenames/placenames.bin index 60ebb29..ee0e4f8 100644 --- a/pkg/placenames/placenames.bin +++ b/pkg/placenames/placenames.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7294ed9778ce80df6bda24d8dc58835fece74071cefbef6b9c93fa3d460b704d -size 1278382 +oid sha256:b70e504f0533e7d0a33e9d57341d9e250a18bba82ed517c4d5bee54b09613ca8 +size 1575749 diff --git a/pkg/placenames/placenames.go b/pkg/placenames/placenames.go index 307c279..f1c6df6 100644 --- a/pkg/placenames/placenames.go +++ b/pkg/placenames/placenames.go @@ -13,6 +13,7 @@ import ( type NamedBoundary struct { Name string + Type string Xmin float64 Ymin float64 Xmax float64 diff --git a/pkg/placenames/summarize.go b/pkg/placenames/summarize.go index 2397f72..af457ab 100644 --- a/pkg/placenames/summarize.go +++ b/pkg/placenames/summarize.go @@ -42,6 +42,7 @@ func distance(p1, p2 rtreego.Point) float64 { type POI struct { Name string + Type string Distance float64 } @@ -94,7 +95,7 @@ func (gs *GPXSummarizer) SummarizeTrack(r io.Reader) (*TrackSummary, error) { prevPlacePoint = thisPoint prevPoint = thisPoint prevHeight = thisHeight - s.PointsOfInterest = append(s.PointsOfInterest, POI{nn.Name, 0.0}) + s.PointsOfInterest = append(s.PointsOfInterest, POI{Name: nn.Name, Type: nn.Type, Distance: 0.0}) init = false continue } @@ -103,7 +104,7 @@ func (gs *GPXSummarizer) SummarizeTrack(r io.Reader) (*TrackSummary, error) { s.Ascent += ascent } if nn.Contains(thisPoint) && nn.Name != prevPlace && distance(thisPoint, prevPlacePoint) > 0.2 { - s.PointsOfInterest = append(s.PointsOfInterest, POI{nn.Name, s.Distance}) + s.PointsOfInterest = append(s.PointsOfInterest, POI{Name: nn.Name, Type: nn.Type, Distance: s.Distance}) prevPlace = nn.Name prevPlacePoint = thisPoint }