tidwall cfc65a13f6 Refactor repository and build scripts
This commit includes updates that affects the build, testing, and
deployment of Tile38.

- The root level build.sh has been broken up into multiple scripts
  and placed in the "scripts" directory.

- The vendor directory has been updated to follow the Go modules
  rules, thus `make` should work on isolated environments. Also
  some vendored packages may have been updated to a later
  version, if needed.

- The Makefile has been updated to allow for making single
  binaries such as `make tile38-server`. There is some scaffolding
  during the build process, so from now on all binaries should be
  made using make. For example, to run a development version of
  the tile38-cli binary, do this:
     make tile38-cli && ./tile38-cli
  not this:
     go run cmd/tile38-cli/main.go

- Travis.CI docker push script has been updated to address a
  change to Docker's JSON repo meta output, which in turn fixes
  a bug where new Tile38 versions were not being properly pushed
  to Docker
2019-11-18 10:33:15 -07:00

90 lines
2.0 KiB
Go

package geojson
import "github.com/tidwall/geojson/geometry"
// Spatial ...
type Spatial interface {
WithinRect(rect geometry.Rect) bool
WithinPoint(point geometry.Point) bool
WithinLine(line *geometry.Line) bool
WithinPoly(poly *geometry.Poly) bool
IntersectsRect(rect geometry.Rect) bool
IntersectsPoint(point geometry.Point) bool
IntersectsLine(line *geometry.Line) bool
IntersectsPoly(poly *geometry.Poly) bool
DistanceRect(rect geometry.Rect) float64
DistancePoint(point geometry.Point) float64
DistanceLine(line *geometry.Line) float64
DistancePoly(poly *geometry.Poly) float64
}
var _ = []Spatial{
&Point{}, &LineString{}, &Polygon{}, &Feature{},
&MultiPoint{}, &MultiLineString{}, &MultiPolygon{},
&GeometryCollection{}, &FeatureCollection{}, &Rect{},
EmptySpatial{},
}
// EmptySpatial ...
type EmptySpatial struct{}
// WithinRect ...
func (s EmptySpatial) WithinRect(rect geometry.Rect) bool {
return false
}
// WithinPoint ...
func (s EmptySpatial) WithinPoint(point geometry.Point) bool {
return false
}
// WithinLine ...
func (s EmptySpatial) WithinLine(line *geometry.Line) bool {
return false
}
// WithinPoly ...
func (s EmptySpatial) WithinPoly(poly *geometry.Poly) bool {
return false
}
// IntersectsRect ...
func (s EmptySpatial) IntersectsRect(rect geometry.Rect) bool {
return false
}
// IntersectsPoint ...
func (s EmptySpatial) IntersectsPoint(point geometry.Point) bool {
return false
}
// IntersectsLine ...
func (s EmptySpatial) IntersectsLine(line *geometry.Line) bool {
return false
}
// IntersectsPoly ...
func (s EmptySpatial) IntersectsPoly(poly *geometry.Poly) bool {
return false
}
// DistanceRect ...
func (s EmptySpatial) DistanceRect(rect geometry.Rect) float64 {
return 0
}
// DistancePoint ...
func (s EmptySpatial) DistancePoint(point geometry.Point) float64 {
return 0
}
// DistanceLine ...
func (s EmptySpatial) DistanceLine(line *geometry.Line) float64 {
return 0
}
// DistancePoly ...
func (s EmptySpatial) DistancePoly(poly *geometry.Poly) float64 {
return 0
}