Transformer

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDXFToGeoJSON2

func ConvertDXFToGeoJSON2(dxfFilePath string) (*geojson.FeatureCollection, string)

func ConvertGeoJSONToSHP

func ConvertGeoJSONToSHP(GeoData *geojson.FeatureCollection, shpfileFilePath string)

func ConvertGeoJSONToSHP3

func ConvertGeoJSONToSHP3(GeoData *geojson.FeatureCollection, shpfileFilePath string)

func ConvertPointToArrow

func ConvertPointToArrow(pics []models.GeoPic, shpfileFilePath string)

func ConvertPolygonToMultiPolygon

func ConvertPolygonToMultiPolygon(points []shp.Point, parts []int32) (orb.MultiPolygon, string)

func ConvertSHPToGeoJSON2

func ConvertSHPToGeoJSON2(shpfileFilePath string) (*geojson.FeatureCollection, string)

func CoordTransform4326To4523

func CoordTransform4326To4523(x, y float64) (x1, y1 float64)

CoordTransform 函数将EPSG:4523坐标转换为EPSG:4326坐标

func CoordTransformAToB

func CoordTransformAToB(x float64, y float64, A string, B string) (x1, y1 float64)

CoordTransform 函数将EPSG:4523坐标转换为EPSG:4326坐标

func DatToGeojson

func DatToGeojson(FilePath string) (*geojson.FeatureCollection, string)

func FindFiles

func FindFiles(root string, Exc string) []string

func GbkToUtf8

func GbkToUtf8(s string) string

func GeoJsonTransformTo4326

func GeoJsonTransformTo4326(original *geojson.FeatureCollection, EPSG string) (*geojson.FeatureCollection, error)

35带转换

func GeoJsonTransformToCGCS

func GeoJsonTransformToCGCS(original *geojson.FeatureCollection) (*geojson.FeatureCollection, error)

35带转换

func GetFeatureString

func GetFeatureString(originals []*geojson.Feature) string

func GetGeometryString

func GetGeometryString(original *geojson.Feature) string

func IsClockwise

func IsClockwise(points []orb.Point) bool

func KmlToGeojson

func KmlToGeojson(path string) (*geojson.FeatureCollection, string)

func SplitPoints

func SplitPoints(points []shp.Point, parts []int32) [][]shp.Point

func StringToCoords

func StringToCoords(Coords string) []orb.Point

func TrimTrailingZeros

func TrimTrailingZeros(input string) string

func TxtToGeojson

func TxtToGeojson(FilePath string) (*geojson.FeatureCollection, string)

func Utf8ToGbk

func Utf8ToGbk(input string) []byte

Types

type ConvertedPoint

type ConvertedPoint struct {
	Lat float64
	Lng float64
}

type Document

type Document struct {
	Name       string      `xml:"name"`
	Visibility int         `xml:"visibility"`
	Schema     Schema      `xml:"Schema"`
	Folder     Folder      `xml:"Folder"`
	Placemark  []Placemark `xml:"Placemark"`
}

type ExtendedData

type ExtendedData struct {
	SchemaData SchemaData `xml:"SchemaData"`
}

type Folder

type Folder struct {
	ID        string      `xml:"id,attr"`
	Name      string      `xml:"name"`
	Placemark []Placemark `xml:"Placemark"`
}

type GeometryData

type GeometryData struct {
	GeoJSON []byte  `gorm:"column:geojson"` // 假设数据库中存储geojson的列名为"geojson"
	Lenth   float64 `gorm:"column:lenth"`
}

type IconStyle

type IconStyle struct {
	Scale float32 `xml:"scale"`
}

type Kml

type Kml struct {
	XMLName  xml.Name `xml:"kml"`
	Document Document `xml:"Document"`
}

type LabelStyle

type LabelStyle struct {
}

type LineStyle

type LineStyle struct {
	Color           string `xml:"color"`
	Width           int    `xml:"width"`
	LabelVisibility int    `xml:"gx labelVisibility"`
}

type Placemark

type Placemark struct {
	ID            string                `xml:"id,attr"`
	Name          string                `xml:"name"`
	Description   string                `xml:"description"`
	Style         Style                 `xml:"Style"`
	ExtendedData  ExtendedData          `xml:"ExtendedData"`
	LineString    *KmlGeo.LineString    `xml:"LineString"`
	Point         *KmlGeo.Point         `xml:"Point"`
	Polygon       *KmlGeo.Polygon       `xml:"Polygon"`
	MultiGeometry *KmlGeo.MultiGeometry `xml:"MultiGeometry"`
}

type Point

type Point struct {
	X, Y float64
}

方位角生成

func RotatePoint

func RotatePoint(A, B Point, angle float64) Point

RotatePoint rotates point A around point B by the given angle in degrees.

type Schema

type Schema struct {
	Name        string        `xml:"name,attr"`
	ID          string        `xml:"id,attr"`
	SimpleField []SimpleField `xml:"SimpleField"`
}

type SchemaData

type SchemaData struct {
	SimpleData []SimpleData `xml:"SimpleData"`
}

type ShapeData

type ShapeData struct {
	Shape      shp.Shape
	Attributes map[string][]byte
	GeomType   string // "point", "line", "polygon"
}

高性能写出

type SimpleData

type SimpleData struct {
	Name  string `xml:"name,attr"`
	Value string `xml:",chardata"`
}

type SimpleField

type SimpleField struct {
	Type        string `xml:"type,attr"`
	Name        string `xml:"name,attr"`
	DisplayName string `xml:"displayName"`
}

type Style

type Style struct {
	IconStyle  IconStyle  `xml:"IconStyle"`
	LabelStyle LabelStyle `xml:"LabelStyle"`
	LineStyle  LineStyle  `xml:"LineStyle"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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