xvill / xutil Goto Github PK
View Code? Open in Web Editor NEW经纬度转换,sqlldr入库,Geometry工具
License: GNU General Public License v3.0
经纬度转换,sqlldr入库,Geometry工具
License: GNU General Public License v3.0
// MercatorToBd09 墨卡托坐标转百度经纬度坐标
func MercatorToBd09(x, y float64) (float64, float64) {
cF := []float64{}
> tempY := math.Abs(y)
for cE := 0; cE < len(_mcband); cE++ {
if tempY >= _mcband[cE] {
cF = _mc2ll[cE]
break
}
}
return yr(x, y, cF)
}
// Bd09ToMercator 百度经纬度坐标转墨卡托坐标
func Bd09ToMercator(lng, lat float64) (float64, float64) {
getLoop := func(lng float64, min, max float64) float64 {
for lng > max {
> lng = lng - math.Abs(max-min)
}
for lng < min {
>lng = lng + math.Abs(max-min)
}
return lng
}
getRange := func(lat float64, min, max float64) float64 {
return math.Min(math.Max(lat, min), max)
}
cE := []float64{}
lng = getLoop(lng, -180.0, 180.0)
lat = getRange(lat, -74.0, 74.0)
for i := 0; i < len(_llband); i++ {
if lat >= _llband[i] {
cE = _ll2mc[i]
break
}
}
> if len(cE) == 0 {
for i := len(_llband) - 1; i >= 0; i-- {
if lat <= -_llband[i] {
cE = _ll2mc[i]
break
}
}
}
return yr(lng, lat, cE)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.