simplify

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: LGPL-2.1 Imports: 9 Imported by: 0

Documentation

Overview

Package simplify define Douglas Peucker and Topology Preserving simplify.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasInteriorIntersection

func HasInteriorIntersection(seg0, seg1 *matrix.LineSegment) bool

HasInteriorIntersection ..

func IsInLineSection

func IsInLineSection(
	line *TaggedLineString,
	sectionIndex []int,
	seg *matrix.LineSegment) bool

IsInLineSection Tests whether a segment is in a section of a TaggedLineString

func Simplify

func Simplify(geom matrix.Steric, distanceTolerance float64) matrix.Steric

Simplify Simplifies a geometry using a given tolerance.

Types

type DPTransformer

type DPTransformer struct {
	*Transformer
	// contains filtered or unexported fields
}

DPTransformer ...

func (*DPTransformer) Transform

func (d *DPTransformer) Transform(inputGeom matrix.Steric) (matrix.Steric, error)

Transform ...

type DouglasPeuckerLineSimplifier

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

DouglasPeuckerLineSimplifier Simplifies a linestring (sequence of points) using the standard Douglas-Peucker algorithm.

func (*DouglasPeuckerLineSimplifier) Simplify

func (d *DouglasPeuckerLineSimplifier) Simplify() []matrix.Matrix

Simplify Simplifies a linestring (sequence of points) using the standard Douglas-Peucker algorithm.

type DouglasPeuckerSimplifier

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

DouglasPeuckerSimplifier Simplifies a Geometry using the Douglas-Peucker algorithm.

Ensures that any polygonal geometries returned are valid.
Simple lines are not guaranteed to remain simple after simplification.
All geometry types are handled.
Empty and point geometries are returned unchanged.
Empty geometry components are deleted.

type LineSegmentIndex

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

LineSegmentIndex An spatial index on a set of LineSegments. Supports adding and removing items.

func (*LineSegmentIndex) Add

func (l *LineSegmentIndex) Add(line matrix.LineMatrix)

Add add a LineMatrix.

func (*LineSegmentIndex) AddSegment

func (l *LineSegmentIndex) AddSegment(seg *matrix.LineSegment)

AddSegment add a LineSegment.

func (*LineSegmentIndex) Query

func (l *LineSegmentIndex) Query(querySeg *matrix.LineSegment) []*matrix.LineSegment

Query query LineSegment returns array TaggedLineSegment.

func (*LineSegmentIndex) Remove

func (l *LineSegmentIndex) Remove(seg *TaggedLineSegment)

Remove remove a TaggedLineSegment.

type LineStringMapBuilderFilter

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

LineStringMapBuilderFilter A filter to add linear geometries to the linestring map

with the appropriate minimum size constraint.
For all other linestrings, the minimum size is 2 points.

func (*LineStringMapBuilderFilter) Clear added in v1.0.2

func (l *LineStringMapBuilderFilter) Clear()

Clear clear Matrixes.

func (*LineStringMapBuilderFilter) Filter added in v1.0.2

func (l *LineStringMapBuilderFilter) Filter(geom matrix.Matrix)

Filter linear geometries.

func (*LineStringMapBuilderFilter) FilterMatrixes added in v1.0.2

func (l *LineStringMapBuilderFilter) FilterMatrixes(matrixes []matrix.Matrix)

FilterMatrixes Performs an operation with the provided .

func (*LineStringMapBuilderFilter) IsChanged added in v1.0.2

func (l *LineStringMapBuilderFilter) IsChanged() bool

IsChanged Returns the true when need change.

func (*LineStringMapBuilderFilter) Matrixes added in v1.0.2

func (l *LineStringMapBuilderFilter) Matrixes() []matrix.Matrix

Matrixes Returns the gathered Matrixes.

type LineStringTransformer

type LineStringTransformer struct {
	Transformer
	// contains filtered or unexported fields
}

LineStringTransformer Transformer A framework for processes which transform an input linestring into

an output Geometry, possibly changing its structure and type(s).

func (*LineStringTransformer) Transform

func (l *LineStringTransformer) Transform(inputGeom matrix.Steric) (matrix.Steric, error)

Transform ...

type TaggedLineSegment

type TaggedLineSegment struct {
	*matrix.LineSegment
	Parent matrix.Steric
	Index  int
}

TaggedLineSegment A LineSegment which is tagged with its location in a parent Geometry.

Used to index the segments in a geometry and recover the segment locations
from the index.

func TaggedLineSegmentFour

func TaggedLineSegmentFour(p0, p1 matrix.Matrix, parent matrix.Steric, index int) *TaggedLineSegment

TaggedLineSegmentFour four parameters create TaggedLineSegmentFour.

func TaggedLineSegmentTwo

func TaggedLineSegmentTwo(p0, p1 matrix.Matrix) *TaggedLineSegment

TaggedLineSegmentTwo two parameters create TaggedLineSegmentFour.

type TaggedLineString

type TaggedLineString struct {
	ParentLine matrix.LineMatrix
	Segs       []*TaggedLineSegment

	MinimumSize int
	// contains filtered or unexported fields
}

TaggedLineString Represents a LineString which can be modified to a simplified shape.

This class provides an attribute which specifies the minimum allowable length for the modified result.

func (*TaggedLineString) AddToResult

func (t *TaggedLineString) AddToResult(seg *matrix.LineSegment)

AddToResult ...

func (*TaggedLineString) AsLine

func (t *TaggedLineString) AsLine() matrix.LineMatrix

AsLine ...

func (*TaggedLineString) GetParentMatrixes

func (t *TaggedLineString) GetParentMatrixes() []matrix.Matrix

GetParentMatrixes ...

func (*TaggedLineString) GetResultMatrixes

func (t *TaggedLineString) GetResultMatrixes() []matrix.Matrix

GetResultMatrixes ...

func (*TaggedLineString) GetResultSize

func (t *TaggedLineString) GetResultSize() int

GetResultSize ...

func (*TaggedLineString) GetSegment

func (t *TaggedLineString) GetSegment(i int) *TaggedLineSegment

GetSegment ...

type TaggedLineStringSimplifier

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

TaggedLineStringSimplifier Simplifies a TaggedLineString, preserving topology

(in the sense that no new intersections are introduced). Uses the recursive Douglas-Peucker algorithm.

func (*TaggedLineStringSimplifier) Remove

func (t *TaggedLineStringSimplifier) Remove(line *TaggedLineString,
	start, end int)

Remove Remove the segs in the section of the line

func (*TaggedLineStringSimplifier) Simplify

func (t *TaggedLineStringSimplifier) Simplify(line *TaggedLineString)

Simplify Simplifies the given TaggedLineString using the distance tolerance specified.

type TaggedLinesSimplifier

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

TaggedLinesSimplifier Simplifies a collection of TaggedLineStrings, preserving topology

(in the sense that no new intersections are introduced).

func (*TaggedLinesSimplifier) Simplify

func (t *TaggedLinesSimplifier) Simplify(taggedLines []*TaggedLineString)

Simplify Simplify a collection of TaggedLineStrings

type TopologyPreservingSimplifier

type TopologyPreservingSimplifier struct {
	InputGeom matrix.Steric
	// contains filtered or unexported fields
}

TopologyPreservingSimplifier Simplifies a geometry and ensures that

the result is a valid geometry having the
same dimension and number of components as the input,
and with the components having the same topological relationship.

func (*TopologyPreservingSimplifier) Simplify

func (t *TopologyPreservingSimplifier) Simplify(geom matrix.Steric, distanceTolerance float64) matrix.Steric

Simplify ...

type Trans

type Trans interface {
	// Transform ...
	Transform(inputGeom matrix.Steric) (matrix.Steric, error)
	// contains filtered or unexported methods
}

Trans A framework for processes which transform an input Geometry into

an output  Geometry, possibly changing its structure and type(s).

type Transformer

type Transformer struct {
	InputGeom matrix.Steric
	// contains filtered or unexported fields
}

Transformer A framework for processes which transform an input Geometry into

an output  Geometry, possibly changing its structure and type(s).

func (*Transformer) Transform

func (t *Transformer) Transform(inputGeom matrix.Steric) (matrix.Steric, error)

Transform ...

Jump to

Keyboard shortcuts

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