limit

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 9 Imported by: 33

Documentation

Overview

Package limit provides functions to clip geometries at polygon boundaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter struct {
	// contains filtered or unexported fields
}

func NewFromGeoJSON

func NewFromGeoJSON(source string, buffer float64, targetSRID int) (*Limiter, error)

func (*Limiter) Clip

func (l *Limiter) Clip(geom *geos.Geom) ([]*geos.Geom, error)

Clip returns geom (in targetSRID) clipped to the LimitTo geometry. Returns nil if geom is outside of the LimitTo geometry. Returns only similar geometry types (e.g. clipped Polygon will return one or more Polygons, but no LineString or Point, etc.)

func (*Limiter) IntersectsBuffer

func (l *Limiter) IntersectsBuffer(g *geos.Geos, x, y float64) bool

IntersectsBuffer returns true if the point (EPSG:4326) intersects the buffered LimitTo geometry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL