Skip to content

Commit

Permalink
add spatial.PointInPolygonCandidate; rip out geojson stuff from datab…
Browse files Browse the repository at this point in the history
…ase interface
  • Loading branch information
thisisaaronland committed Dec 16, 2020
1 parent e62a5cf commit b821a96
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ type SpatialDatabase interface {
PointInPolygonCandidates(context.Context, *geom.Coord) (*geojson.FeatureCollection, error)
PointInPolygonWithChannels(context.Context, chan spr.StandardPlacesResult, chan error, chan bool, *geom.Coord, ...filter.Filter)
PointInPolygonCandidatesWithChannels(context.Context, *geom.Coord, chan *geojson.Feature, chan error, chan bool)
StandardPlacesResultsToFeatureCollection(context.Context, spr.StandardPlacesResults) (*geojson.FeatureCollection, error)
Close(context.Context) error
}
```
Expand Down
7 changes: 3 additions & 4 deletions database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"fmt"
"github.com/aaronland/go-roster"
"github.com/paulmach/go.geojson"
"github.com/skelterjohn/geom"
wof_geojson "github.com/whosonfirst/go-whosonfirst-geojson-v2"
"github.com/whosonfirst/go-whosonfirst-spatial"
"github.com/whosonfirst/go-whosonfirst-spatial/filter"
"github.com/whosonfirst/go-whosonfirst-spr"
"net/url"
Expand All @@ -17,10 +17,9 @@ import (
type SpatialDatabase interface {
IndexFeature(context.Context, wof_geojson.Feature) error
PointInPolygon(context.Context, *geom.Coord, ...filter.Filter) (spr.StandardPlacesResults, error)
PointInPolygonCandidates(context.Context, *geom.Coord, ...filter.Filter) (*geojson.FeatureCollection, error)
PointInPolygonCandidates(context.Context, *geom.Coord, ...filter.Filter) ([]*spatial.PointInPolygonCandidate, error)
PointInPolygonWithChannels(context.Context, chan spr.StandardPlacesResult, chan error, chan bool, *geom.Coord, ...filter.Filter)
PointInPolygonCandidatesWithChannels(context.Context, chan *geojson.Feature, chan error, chan bool, *geom.Coord, ...filter.Filter)
StandardPlacesResultsToFeatureCollection(context.Context, spr.StandardPlacesResults) (*geojson.FeatureCollection, error)
PointInPolygonCandidatesWithChannels(context.Context, chan *spatial.PointInPolygonCandidate, chan error, chan bool, *geom.Coord, ...filter.Filter)
Close(context.Context) error
}

Expand Down
11 changes: 11 additions & 0 deletions spatial.go
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
package spatial

import (
"github.com/skelterjohn/geom"
)

type PointInPolygonCandidate struct {
Id int64
WOFId string
AltLabel string
Bounds *geom.Rect
}

0 comments on commit b821a96

Please sign in to comment.