pointindex

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VectorTileInternalPixelResolution = 16
)

Variables

This section is empty.

Functions

func DeviationStats

func DeviationStats(tms tms20.TileMatrixSet, deepestTMID tms20.TMID) (stats string, deviationInUnits, deviationInPixels float64, err error)

DeviationStats calcs some stats to show the result of using ints internally if the res (span/size) is not "round" (with intgeom.Precision), a deviation will arise

func IsQuadTree

func IsQuadTree(tms tms20.TileMatrixSet) error

Types

type Level

type Level = uint

type OutsideGridError added in v0.0.8

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

func (OutsideGridError) Error added in v0.0.8

func (e OutsideGridError) Error() string

type PointIndex

type PointIndex struct {
	Quadrant
	// contains filtered or unexported fields
}

PointIndex is a pointcloud annex quadtree to enable snapping lines to a grid accounting for those points. Quadrants:

|-------|
| 2 | 3 |
|-------|
| 0 | 1 |
|-------|

Edges:

          exc
   maxX    2    maxY
       |-------|
       | 3 | 2 |
inc  3 |-------| 1  exc
       | 0 | 1 |
       |-------|
   minX    0    maxX
          inc

func FromTileMatrixSet

func FromTileMatrixSet(tileMatrixSet tms20.TileMatrixSet, deepestTMID tms20.TMID) (*PointIndex, error)

func (*PointIndex) GetHitMultiple

func (ix *PointIndex) GetHitMultiple(l Level) map[intgeom.Point][]int

func (*PointIndex) InsertCoord

func (ix *PointIndex) InsertCoord(deepestX int, deepestY int) error

InsertCoord inserts a Point by its x/y coord on the deepest level

func (*PointIndex) InsertPoint

func (ix *PointIndex) InsertPoint(point geom.Point) error

InsertPoint inserts a Point by its absolute coord

func (*PointIndex) InsertPolygon

func (ix *PointIndex) InsertPolygon(polygon geom.Polygon) error

InsertPolygon inserts all points from a Polygon

func (*PointIndex) SnapClosestPoints

func (ix *PointIndex) SnapClosestPoints(line geom.Line, levelMap map[Level]any, ringID int) map[Level][][2]float64

SnapClosestPoints returns the points (centroids) in the index that are intersected by a line on multiple levels

func (*PointIndex) ToWkt

func (ix *PointIndex) ToWkt(writer io.Writer)

ToWkt creates a WKT representation of the pointcloud. For debugging/visualising.

type Q

type Q = int // quadrant index (0, 1, 2 or 3)

type Quadrant

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

Jump to

Keyboard shortcuts

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