npm install terraformer-wkt-parser --save
import WKT from "terraformer-wkt-parser"
var geometryWKT = "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0), (100.2 0.2, 100.8 0.2, 100.8 0.8, 100.2 0.8, 100.2 0.2))"
var geometryGeojson: {
geometry:[
type:Polygon,
coordinates:[
[118.16483913122546,33.45007],
[118.16483913122546,33.45007],
[118.16483913122546,33.45007]
]
}
wkt转geojson:WKT.parse(geometryWKT );
geojson转wkt:WKT.convert( geometryGeojson)
前端实现geoJson与wkt格式互转
最新推荐文章于 2024-06-25 10:26:03 发布