mirror of https://github.com/tidwall/tile38.git
16 lines
304 B
Go
16 lines
304 B
Go
package clip
|
|
|
|
import (
|
|
"github.com/tidwall/geojson"
|
|
"github.com/tidwall/geojson/geometry"
|
|
)
|
|
|
|
func clipPoint(
|
|
point *geojson.Point, clipper geojson.Object, opts *geometry.IndexOptions,
|
|
) geojson.Object {
|
|
if point.IntersectsRect(clipper.Rect()) {
|
|
return point
|
|
}
|
|
return geojson.NewMultiPoint(nil)
|
|
}
|