常见gis几何格式(wkt、geojson、arcgis json)的转换方法

1.相关链接

https://github.com/terraformer-js/terraformer

2.arcgis geometry json与geojson互转

Convert ArcGIS JSON geometries to GeoJSON geometries and vice versa.

复制代码
npm install @terraformer/arcgis

(1)arcgis geometry json转换成geojson格式

复制代码
import { arcgisToGeoJSON } from "@terraformer/arcgis"

arcgisToGeoJSON({
  "x":-122.6764,
  "y":45.5165,
  "spatialReference": {
    "wkid": 4326
  }
});

>> { "type": "Point", "coordinates": [ -122.6764, 45.5165 ] }

(2)geojson转换成arcgis geometry json

复制代码
import { geojsonToArcGIS } from "@terraformer/arcgis"

geojsonToArcGIS({
  "type": "Point",
  "coordinates": [45.5165, -122.6764]
})

>> { "x":-122.6764, "y":45.5165, "spatialReference": { "wkid": 4326 } }

3.wkt与geojson格式互转

Tools to convert WKT geometries to GeoJSON geometries and vice versa.

(1)wkt转成geojson

复制代码
import { wktToGeoJSON } from "@terraformer/wkt"

wktToGeoJSON("POINT (-122.6764 45.5165)");

>> { "type": "Point", "coordinates": [ -122.6764, 45.5165 ] }

(2)geojson转成wkt

复制代码
import { geojsonToWKT } from "@terraformer/wkt"

const geojsonPoint = {
  "type": "Point",
  "coordinates": [-122.6764, 45.5165]
}

geojsonToWKT(geojsonPoint)

>> "POINT (-122.6764 45.5165)"
相关推荐
新生GIS16 小时前
arcgis-空间矫正工具(将下发数据A的信息放置原始数据B的原始信息并放置到成果数据C中,主要按下发数据A的范围)
arcgis
新生GIS4 天前
arcgis-提取范围中最大占比面积的信息或唯一值
arcgis
圆周率的后六位4 天前
GIS相关调研
arcgis·gis·supermap·gisbox·gis组件
tomelrg5 天前
多台服务器批量发布arcgisserver服务并缓存切片
服务器·python·arcgis
FL16238631296 天前
windows下ArcGIS 10.8.2下载安装教程
arcgis
allenjiao13 天前
Cesium粒子系统模拟风场动态效果
javascript·arcgis·gis·webgl·cesium·三维·风场
杨超越luckly14 天前
HTML应用指南:利用GET请求获取全国Apple Store 零售店位置信息
大数据·前端·arcgis·html·数据可视化·门店
典学长编程15 天前
前端开发(HTML,CSS,VUE,JS)从入门到精通!第八天(Vue框架及其安装)(完结篇) 重点 ! ! !
arcgis·vue·vue路由·vue脚手架·router
Wild Iris17 天前
【ArcGIS】分区统计中出现Null值且Nodata无法忽略的问题以及shp擦除(erase)的使用——以NDVI去水体为例
arcgis
新中地GIS开发老师19 天前
2025Mapbox零基础入门教程(14)定位功能
前端·javascript·arcgis·gis·mapbox·gis开发·地理信息科学