mirror of https://github.com/tidwall/tile38.git
18 lines
403 B
Go
18 lines
403 B
Go
package clip
|
|
|
|
import (
|
|
"github.com/tidwall/geojson"
|
|
"github.com/tidwall/geojson/geometry"
|
|
)
|
|
|
|
func clipFeature(
|
|
feature *geojson.Feature, clipper geojson.Object,
|
|
opts *geometry.IndexOptions,
|
|
) geojson.Object {
|
|
newFeature := Clip(feature.Base(), clipper, opts)
|
|
if _, ok := newFeature.(*geojson.Feature); !ok {
|
|
newFeature = geojson.NewFeature(newFeature, feature.Members())
|
|
}
|
|
return newFeature
|
|
}
|