de9im

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: 5 Imported by: 0

Documentation

Overview

package de9im the criteria for judging the various topological relations between points, line and surface entities in DE-9IM model are given. the method of graph operation and geometric calculation to deduce the specific topological relations among entities by analyzing the structure of points and line vertices and the combination of points and lines

Index

Constants

View Source
const (
	PartInPolygon    = 4
	OnlyInPolygon    = 3
	OnlyInLine       = 2
	OnlyOutPolygon   = -1
	PartOutPolygon   = -2
	DefaultInPolygon = 0
	BothPolygon      = 1
	IncludePolygon   = -3
)

in or out polygon.

View Source
const (
	OddEvenFill = iota
	WindingFill
)

WindingFill: Specifies that the region is filled using the non zero winding rule. With this rule, we determine whether a point is inside the shape by using the following method. Draw a horizontal line from the point to a location outside the shape. Determine whether the direction of the line at each intersection point is up or down. The winding number is determined by summing the direction of each intersection. If the number is non zero, the point is inside the shape. This fill mode can also in most cases be considered as the intersection of closed shapes.

View Source
const (
	Disjoint = iota + 1
	Touch
	Cross
	Within
	Overlap
	Equal
	Contain
	Cover
	CoveredBy
)

relation Symbol

View Source
const (
	RPP1 = iota
	RPP2

	RPL1
	RPL2
	RPL3

	RPA1
	RPA2
	RPA3

	RLL1
	RLL2
	RLL3
	RLL4
	RLL5
	RLL6
	RLL7
	RLL8
	RLL9
	RLL10
	RLL11
	RLL12
	RLL13
	RLL14
	RLL15
	RLL16
	RLL17
	RLL18
	RLL19
	RLL20
	RLL21
	RLL22
	RLL23
	RLL24
	RLL25
	RLL26
	RLL27
	RLL28
	RLL29
	RLL30
	RLL31
	RLL32
	RLL33
	RLL34
	RLL35

	RLA1
	RLA2
	RLA3
	RLA4
	RLA5
	RLA6
	RLA7
	RLA8
	RLA9
	RLA10
	RLA11
	RLA12
	RLA13
	RLA14
	RLA15
	RLA16
	RLA17
	RLA18
	RLA19
	RLA20
	RLA21
	RLA22
	RLA23
	RLA24
	RLA25
	RLA26
	RLA27
	RLA28
	RLA29
	RLA30
	RLA31

	RAA1
	RAA2
	RAA3
	RAA4
	RAA5
	RAA6
	RAA7
	RAA8
	RAA9
	RAA10
	RAA11
)

Relate explain

Variables

View Source
var (
	RelateStrings = []string{

		"FF0FFF0F2", "0FFFFFFF2",

		"FF0FFF102", "0FFFFF102", "F0FFFF102",

		"FF0FFF212", "0FFFFF212", "F0FFFF212",

		"FF1FF0102", "0F1FF0102", "1F1FF0102", "F01FF0102", "F01FF0102",
		"001FF0102", "001FF01F2", "1F10F0102", "1F10FF102", "1FF0FF102",
		"F010FF102", "F010F0102", "F010F0102", "0010FF102", "0010F0102",
		"0010F0102", "1010FF102", "1010F0102", "1010FF102", "FF1F0F102",
		"FF1F00102", "0F1F0F102", "0F1F00102", "1F1F0F102", "1FFF0F102",
		"1F1F00102", "F01F00102", "001F00102", "1F100F102", "1FF00F102",
		"F0100F102", "00100F102", "10100F102", "FF10F0102", "0F10FF102",

		"FF1FF0212", "1FF0FF212", "F01FF0212", "F11FF0212", "10F0FF212",
		"11F0F0212", "101FF0212", "1010F0212", "1010FF212", "111FF0212",
		"1110FF212", "1110F0212", "FF1F0F212", "FF1F00212", "1FF00F212",
		"1FFF0F212", "F11F0F212", "F11F00212", "10FF0F212", "101F00212",
		"101F00212", "10F00F212", "10100F212", "F1FF0F212", "F11F0F212",
		"F11F00212", "11FF0F212", "101F0F212", "1F1F00212", "11F00F212",
		"11100F212",

		"FF2FF1212", "FF2F01212", "FF2F11212", "212101212", "212FF1FF2",
		"2FF1FF212", "2F2F01FF2", "2FF10F212", "2FFF1FFF2", "2FF11F212",
		"212F11FF2",
	}
)

RelateStrings array

Functions

func IM

IM Gets the relate for the spatial relationship between the input geometries.

func IMByClip

func IMByClip(clip *graph.Clip) *matrix.IntersectionMatrix

IMByClip Gets the relate for the spatial relationship between the input geometries.

func IMByRelationship

func IMByRelationship(m0, m1 matrix.Steric, f RelateAlgorithm) *matrix.IntersectionMatrix

IMByRelationship Gets the relate for the spatial relationship between the input geometries.

func IMStructure

func IMStructure(m0, m1 matrix.Steric) *matrix.IntersectionMatrix

IM Gets the relate for the spatial relationship between the input geometries.

func IMTransposeByRing

func IMTransposeByRing(im *matrix.IntersectionMatrix, inputType int) *matrix.IntersectionMatrix

IMTransposeByRing line relate to ring relate Model definition: boundary of point is nil, boundary of line is boundary,two point boundary of ring is nil, boundary of polygon is ring interior is Except boundary exterior exterior boundary and interior

func InPolygon

func InPolygon(point matrix.Matrix, poly matrix.LineMatrix) bool

InPolygon returns true if pt is inside pg.

Segments of the polygon are allowed to cross. InPolygon this case they divide the polygon into multiple regions. The function returns true for points in regions on the perimeter of the polygon. The return value for interior regions is determined by a two coloring of the regions.

If point is exactly on a segment or vertex of polygon, the method may return true or false.

func IsInPolygon

func IsInPolygon(arg matrix.Steric, poly matrix.PolygonMatrix) (int, int)

IsInPolygon returns true if Steric point and entity is inside pg .

Segments of the polygon are allowed to cross. InPolygon this case they divide the polygon into multiple regions. The function returns true for points in regions on the perimeter of the polygon. The return value for interior regions is determined by a two coloring of the regions.

If point is exactly on a segment or vertex of polygon, the method may return true or false.

func PointInPolygon

func PointInPolygon(point matrix.Matrix, poly matrix.LineMatrix) bool

PointInPolygon returns true if pt is inside pg.

Segments of the polygon are allowed to cross. InPolygon this case they divide the polygon into multiple regions. The function returns true for points in regions on the perimeter of the polygon. The return value for interior regions is determined by a two coloring of the regions.

If point is exactly on a segment or vertex of polygon, the method may return true or false.

func Relate

func Relate(m0, m1 matrix.Steric) string

Relate Gets the relate string for the spatial relationship between the input geometries.

func RelateStringsTransposeByRing

func RelateStringsTransposeByRing(rs string, inputType int) string

RelateStringsTransposeByRing line relate to ring relate Model definition: boundary of point is nil, boundary of line is boundary,two point boundary of ring is nil, boundary of polygon is ring interior is Except boundary exterior exterior boundary and interior

Types

type LineRelationshipByDegrees added in v1.1.3

type LineRelationshipByDegrees struct {
	*RelationshipByDegrees
	// contains filtered or unexported fields
}

type PolygonRelationshipByDegrees added in v1.1.3

type PolygonRelationshipByDegrees struct {
	*RelationshipByDegrees
	// contains filtered or unexported fields
}

type RelateAlgorithm

type RelateAlgorithm func(arg []matrix.Steric) Relationship

RelateAlgorithm the entity be used during the relate computation.

type RelateClipAlgorithm

type RelateClipAlgorithm func(clip *graph.Clip) Relationship

RelateClipAlgorithm the entity be used during the relate computation.

type Relationship

type Relationship interface {
	ComputeIM() *matrix.IntersectionMatrix
}

Relationship be used during the relate computation.

func GetRelationship

func GetRelationship(f RelateAlgorithm, arg []matrix.Steric) Relationship

GetRelationship returns algorithm by new Algorithm.

func GetRelationshipByClip

func GetRelationshipByClip(f RelateClipAlgorithm, clip *graph.Clip) Relationship

GetRelationshipByClip returns algorithm by new Algorithm.

type RelationshipByDegrees

type RelationshipByDegrees struct {
	// The operation args into an array so they can be accessed by index
	*graph.Clip

	IM *matrix.IntersectionMatrix

	IsClosed []bool
	// contains filtered or unexported fields
}

RelationshipByDegrees be used during the relate computation.

func (*RelationshipByDegrees) ComputeIM

ComputeIM IntersectionMatrix Gets the IntersectionMatrix for the spatial relationship between the input geometries.

type RelationshipByStructure

type RelationshipByStructure struct {
	// The operation args into an array so they can be accessed by index
	*graph.Clip

	IM *matrix.IntersectionMatrix

	IsClosed []bool
	// contains filtered or unexported fields
}

RelationshipByStructure be used during the relate computation.

func (*RelationshipByStructure) ComputeIM

ComputeIM IntersectionMatrix Gets the IntersectionMatrix for the spatial relationship between the input geometries.

Jump to

Keyboard shortcuts

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