Skip to content

Commit

Permalink
update geo package to use paulmach/orb; update vendor deps
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Oct 7, 2021
1 parent 6015543 commit 210dc71
Show file tree
Hide file tree
Showing 19 changed files with 923 additions and 73 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (p *SpatialApplication) IndexPaths(ctx context.Context, paths ...string) er
err := p.Iterator.IterateURIs(ctx, paths...)

if err != nil {
p.Logger.Fatal("failed to index paths because %s", err)
p.Logger.Fatalf("failed to index paths because %s", err)
}

t2 := time.Since(t1)
Expand Down
6 changes: 3 additions & 3 deletions geo/boundingbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package geo

import (
"errors"
"github.com/skelterjohn/geom"
"github.com/paulmach/orb"
)

func NewBoundingBox(minx float64, miny float64, maxx float64, maxy float64) (*geom.Rect, error) {
func NewBoundingBox(minx float64, miny float64, maxx float64, maxy float64) (*orb.Bound, error) {

if !IsValidLongitude(minx) {
return nil, errors.New("Invalid min longitude")
Expand Down Expand Up @@ -43,7 +43,7 @@ func NewBoundingBox(minx float64, miny float64, maxx float64, maxy float64) (*ge
return nil, err
}

rect := &geom.Rect{
rect := &orb.Bound{
Min: *min_coord,
Max: *max_coord,
}
Expand Down
10 changes: 3 additions & 7 deletions geo/coord.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package geo

import (
"errors"
"github.com/skelterjohn/geom"
"github.com/paulmach/orb"
)

func NewCoordinate(x float64, y float64) (*geom.Coord, error) {
func NewCoordinate(x float64, y float64) (*orb.Point, error) {

if !IsValidLatitude(y) {
return nil, errors.New("Invalid latitude")
Expand All @@ -15,10 +15,6 @@ func NewCoordinate(x float64, y float64) (*geom.Coord, error) {
return nil, errors.New("Invalid longitude")
}

coord := &geom.Coord{
X: x,
Y: y,
}

coord := &orb.Point{x, y}
return coord, nil
}
59 changes: 0 additions & 59 deletions geo/geojson.go

This file was deleted.

3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ go 1.16

require (
github.com/aaronland/go-roster v0.0.2
github.com/paulmach/orb v0.2.2
github.com/sfomuseum/go-flags v0.8.2
github.com/skelterjohn/geom v0.0.0-20180103142417-96f3e8a219c5
github.com/tidwall/gjson v1.9.2
github.com/tidwall/sjson v1.2.2
github.com/whosonfirst/go-reader v0.9.0
github.com/whosonfirst/go-sanitize v0.1.0
github.com/whosonfirst/go-whosonfirst-feature v0.0.7
github.com/whosonfirst/go-whosonfirst-feature v0.0.12
github.com/whosonfirst/go-whosonfirst-flags v0.4.3
github.com/whosonfirst/go-whosonfirst-iterate/v2 v2.0.0
github.com/whosonfirst/go-whosonfirst-placetypes v0.3.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ github.com/whosonfirst/go-whosonfirst-crawl v0.2.1 h1:nNG7r7/4MaII/NM8Df2oqgfgVN
github.com/whosonfirst/go-whosonfirst-crawl v0.2.1/go.mod h1:MTD1TCgAkXlAtysPU98ylrz9Y5+ZCfRrsrBnRyiH/t8=
github.com/whosonfirst/go-whosonfirst-feature v0.0.7 h1:KweSqcJenzI01zCgbVUzjAlzFmXJMDRVX68mpHRSRUg=
github.com/whosonfirst/go-whosonfirst-feature v0.0.7/go.mod h1:NhUZ9XDyqQiOipFIBvbmixwfM6jtSzP2lX5dxcWX5uw=
github.com/whosonfirst/go-whosonfirst-feature v0.0.12 h1:SNZdeOhQ4XXid4g4iJ5/H6y0tU4rOGn/41M/knVgFMM=
github.com/whosonfirst/go-whosonfirst-feature v0.0.12/go.mod h1:NhUZ9XDyqQiOipFIBvbmixwfM6jtSzP2lX5dxcWX5uw=
github.com/whosonfirst/go-whosonfirst-flags v0.2.0/go.mod h1:ECd0AJJZIlybmjTGB9z+CPz9pSiMTwxur7fPKmDnoqI=
github.com/whosonfirst/go-whosonfirst-flags v0.4.2 h1:HWjy/0MfAQMdCj4M9hi3LAITgK/D+cuDWGHP37mFeZo=
github.com/whosonfirst/go-whosonfirst-flags v0.4.2/go.mod h1:kewFjxBiE00SqjjIanm5DPI81SYvx93wVb3ogwV/PMk=
Expand Down
82 changes: 82 additions & 0 deletions vendor/github.com/paulmach/orb/geojson/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions vendor/github.com/paulmach/orb/geojson/bbox.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 106 additions & 0 deletions vendor/github.com/paulmach/orb/geojson/feature.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 210dc71

Please sign in to comment.