pgmvt

package
v1.6.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const HEMI_MAP_WIDTH = math.Pi * float64(6378137)
View Source
const PRECISION = 6

Variables

This section is empty.

Functions

func AddGDBDirectlyOptimized

func AddGDBDirectlyOptimized(DB *gorm.DB, gdbPath string, targetLayers []string, Main string, Color string, Opacity string, Userunits string, LineWidth string) []string

AddGDBDirectlyOptimized 优化后的GDB导入函数

func AddGeoDirectly

func AddGeoDirectly(DB *gorm.DB, dirpath string, EN string, CN string, Main string, Color string, Opacity string, Userunits string, addType string, LineWidth string) string

func AddSHPDirectlyOptimized

func AddSHPDirectlyOptimized(DB *gorm.DB, shpPath string, EN, CN, Main string, Color string, Opacity string, Userunits string, LineWidth string) string

AddSHPDirectlyOptimized 优化版本:直接将SHP文件导入到PostGIS数据库

func Bounds

func Bounds(geo orb.Geometry) []tile

func ConvertSHPDirectlyToPG

func ConvertSHPDirectlyToPG(shpfileFilePath string, DB *gorm.DB, tablename string) string

直接将SHP文件写入PostgreSQL数据库

func DelMVT

func DelMVT(DB *gorm.DB, tablename string, geom orb.Geometry)

func DelMVTALL added in v1.3.23

func DelMVTALL(DB *gorm.DB, tablename string)

func Epsg3857_to_epsg4326

func Epsg3857_to_epsg4326(x float64, y float64) (float64, float64)

func Epsg4326_to_epsg3857

func Epsg4326_to_epsg3857(lon float64, lat float64) (float64, float64)

func GetPointTile

func GetPointTile(x float64, y float64) []tile

func GetTableColumns

func GetTableColumns(db *gorm.DB, tableName string) ([]string, error)

func IsEndWithNumber

func IsEndWithNumber(s string) bool

func KeepTile

func KeepTile(zoom_level int64, tiles []tile) []tile

func LonLatToTile

func LonLatToTile(lon, lat float64, zoom int64) (x, y int64)

func MakeMvtNew

func MakeMvtNew(x int, y int, z int, tableName string, db *gorm.DB) []byte

func TileGenerate

func TileGenerate(xmin, ymin, xmax, ymax float64) []tile

func TileToLatLon

func TileToLatLon(z, x, y int) (topLeft, topRight, bottomLeft, bottomRight [2]float64)

func UpdateGDBDirectly

func UpdateGDBDirectly(DB *gorm.DB, gdbPath string, EN, CN, Main string, Color string, Opacity string, Userunits, AddType string, LineWidth string) []string

将gdb文件图层全部更新到数据库中

func UpdateSHPDirectly

func UpdateSHPDirectly(DB *gorm.DB, shpPath string, EN, CN, Main string, Color string, Opacity string, Userunits, AddType string, LineWidth string) []string

使用Gdal实现 UpdateSHPDirectly 将SHP文件直接更新到数据库中

func XyzLonLat

func XyzLonLat(x float64, y float64, z float64) []float64

Types

type ChangeCoord added in v1.6.4

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

func NewChangeCoord added in v1.6.4

func NewChangeCoord() *ChangeCoord

NewChangeCoord 初始化坐标转换对象

func (*ChangeCoord) BD09ToGCJ02 added in v1.6.4

func (c *ChangeCoord) BD09ToGCJ02(lng, lat float64) (float64, float64)

BD09ToGCJ02 百度坐标系(BD-09)转火星坐标系(GCJ-02)

func (*ChangeCoord) BD09ToWGS84 added in v1.6.4

func (c *ChangeCoord) BD09ToWGS84(lng, lat float64) (float64, float64)

BD09ToWGS84 bd09转wgs84坐标

func (*ChangeCoord) BD09mcToGCJ02 added in v1.6.4

func (c *ChangeCoord) BD09mcToGCJ02(lng, lat float64) (float64, float64)

BD09mcToGCJ02 百度平面转gcj02坐标

func (*ChangeCoord) BD09mcToWGS84 added in v1.6.4

func (c *ChangeCoord) BD09mcToWGS84(lng, lat float64) (float64, float64)

BD09mcToWGS84 百度平面转wgs84坐标

func (*ChangeCoord) Convert added in v1.6.4

func (c *ChangeCoord) Convert(lng, lat float64, f []float64) (float64, float64)

Convert 平面转经纬计算公式

func (*ChangeCoord) DB09mcToBD09 added in v1.6.4

func (c *ChangeCoord) DB09mcToBD09(mercartorX, mercartorY float64) (float64, float64)

DB09mcToBD09 百度平面转经纬

func (*ChangeCoord) GCJ02ToBD09 added in v1.6.4

func (c *ChangeCoord) GCJ02ToBD09(lng, lat float64) (float64, float64)

GCJ02ToBD09 火星坐标系(GCJ-02)转百度坐标系(BD-09)

func (*ChangeCoord) GCJ02ToWGS84 added in v1.6.4

func (c *ChangeCoord) GCJ02ToWGS84(lng, lat float64) (float64, float64)

GCJ02ToWGS84 GCJ02(火星坐标系)转WGS84---迭代逼近法

func (*ChangeCoord) OutOfChina added in v1.6.4

func (c *ChangeCoord) OutOfChina(lng, lat float64) bool

OutOfChina 判断是否在国内

func (*ChangeCoord) WGS84ToBD09 added in v1.6.4

func (c *ChangeCoord) WGS84ToBD09(lng, lat float64) (float64, float64)

WGS84ToBD09 wgs84坐标转bd09

func (*ChangeCoord) WGS84ToGCJ02 added in v1.6.4

func (c *ChangeCoord) WGS84ToGCJ02(lng, lat float64) (float64, float64)

WGS84ToGCJ02 WGS84转GCJ02(火星坐标系)

type MVTTile

type MVTTile struct {
	MVT []byte
}

type ProcessedFieldInfo

type ProcessedFieldInfo struct {
	OriginalName  string
	ProcessedName string
	DBType        string
}

ProcessedFieldInfo 处理后的字段信息

func ConvertGDBLayerToPGDirect

func ConvertGDBLayerToPGDirect(layer Gogeo.GDBLayerInfo, DB *gorm.DB, tableName string) []ProcessedFieldInfo

直接将GDB图层数据写入PostgreSQL

func ConvertGDBLayerToPGDirectWithMeta added in v1.6.4

func ConvertGDBLayerToPGDirectWithMeta(layer Gogeo.GDBLayerInfo, DB *gorm.DB, tableName string, layerMeta *Gogeo.GDBLayerMetaData) []ProcessedFieldInfo

ConvertGDBLayerToPGDirectWithMeta 带元数据的图层转换函数

func ConvertSHPLayerToPGDirect

func ConvertSHPLayerToPGDirect(layer Gogeo.SHPLayerInfo, DB *gorm.DB, tableName string) []ProcessedFieldInfo

ConvertSHPLayerToPGDirect 直接将SHP图层数据写入PostgreSQL

type SourceConfig added in v1.3.4

type SourceConfig struct {
	SourcePath      string               `json:"source_path"`
	SourceLayerName string               `json:"source_layer_name"`
	SourceLayerSRS  int                  `json:"source_layer_srs"` //EPSG代码
	KeyAttribute    string               `json:"key_attribute"`
	AttMap          []ProcessedFieldInfo `json:"att_map"`
}

Jump to

Keyboard shortcuts

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