Tin

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPolygonInfo

func GetPolygonInfo(polygon *Polygon2D) map[string]interface{}

GetPolygonInfo 获取多边形的基本信息

Types

type Edge3D

type Edge3D struct {
	P1, P2 *Point3D
}

Edge3D 表示一条三维边

type GeoJSONGeometry

type GeoJSONGeometry struct {
	Type        string          `json:"type"`
	Coordinates json.RawMessage `json:"coordinates"`
}

GeoJSONGeometry 表示GeoJSON几何对象的结构

type Point2D

type Point2D struct {
	X, Y float64
	ID   int
}

Point2D 表示一个二维点

type Point3D

type Point3D struct {
	X, Y, Z float64
	ID      int
}

Point3D 表示一个三维点

func CoordsToPoint3D

func CoordsToPoint3D(coords [][]float64) ([]*Point3D, error)

type Polygon2D

type Polygon2D struct {
	Points []*Point2D
}

Polygon2D 表示一个二维多边形面

func GeometryStringToMultiPolygon2D

func GeometryStringToMultiPolygon2D(geometryStr string) ([]*Polygon2D, error)

GeometryStringToMultiPolygon2D 将GeoJSON Geometry字符串转换为多个独立的Polygon2D对象 每个多边形只包含外环,适用于MultiPolygon数据

func GeometryStringToPolygon2D

func GeometryStringToPolygon2D(geometryStr string) (*Polygon2D, error)

GeometryStringToPolygon2D 将GeoJSON Geometry字符串转换为Polygon2D对象 支持的几何类型:Polygon, MultiPolygon 对于MultiPolygon,返回第一个多边形;对于有洞的多边形,只返回外环

func GeometryStringToPolygon2DWithAllRings

func GeometryStringToPolygon2DWithAllRings(geometryStr string) ([]*Polygon2D, error)

GeometryStringToPolygon2DWithAllRings 将GeoJSON Geometry字符串转换为多个Polygon2D对象 返回所有的环(外环和内环),适用于需要处理带洞多边形的情况

type TIN3D

type TIN3D struct {
	Points    []*Point3D
	Triangles []*Triangle3D
	Edges     []*Edge3D
}

TIN3D 三维三角不规则网络

func CreateTIN3D

func CreateTIN3D(polygon *Polygon2D, points3D []*Point3D) *TIN3D

创建三维TIN

func (*TIN3D) GetElevationAt

func (tin *TIN3D) GetElevationAt(x, y float64) (float64, error)

获取二维点在TIN上的投影高程

func (*TIN3D) GetElevationGrid

func (tin *TIN3D) GetElevationGrid(minX, minY, maxX, maxY float64, stepX, stepY float64) ([][]float64, error)

获取指定区域内的高程网格

func (*TIN3D) GetElevationsAt

func (tin *TIN3D) GetElevationsAt(points []Point2D) ([]float64, error)

批量获取多个点的高程

func (*TIN3D) GetSlopeAndAspect

func (tin *TIN3D) GetSlopeAndAspect(x, y float64, delta float64) (slope, aspect float64, err error)

计算指定点的坡度和坡向

func (*TIN3D) Print

func (tin *TIN3D) Print()

打印TIN信息

type Triangle3D

type Triangle3D struct {
	P1, P2, P3 *Point3D
	ID         int
}

Triangle3D 表示一个三维三角形

func (*Triangle3D) Area

func (t *Triangle3D) Area() float64

计算三角形面积(三维)

func (*Triangle3D) Normal

func (t *Triangle3D) Normal() (float64, float64, float64)

计算三角形法向量

Jump to

Keyboard shortcuts

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