您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
GeoWKTer is a JavaScript library designed to convert Well-Known Text (WKT) representations of geometries into GeoJSON format. This tool is useful for developers and GIS specialists who need to work with geographic data across different standards.
此脚本不应直接安装,它是供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/523986/1575829/GeoWKTer.js
GeoWKTer is a JavaScript library designed to facilitate the conversion of Well-Known Text (WKT) geometries into GeoJSON format. This library is especially beneficial for developers and GIS specialists working with geographic data across varying standards. By implementing robust methods for parsing and conversion, GeoWKTer ensures seamless transitions between WKT and GeoJSON representations.
POINT
, LINESTRING
, POLYGON
, MULTIPOINT
, MULTILINESTRING
, MULTIPOLYGON
, and GEOMETRYCOLLECTION
.FeatureCollections
.Below is a basic example of how to use the GeoWKTer library:
// Initialize the GeoWKTer instance
let geoWKTer = new GeoWKTer();
// Example WKT input
let wktText = "GEOMETRYCOLLECTION(POINT(4 6), LINESTRING(4 6, 7 10))";
// Convert WKT to GeoJSON
let wktDataArray = geoWKTer.read(wktText, 'Example Label');
let geoJsonData = geoWKTer.toGeoJSON(wktDataArray);
// Output GeoJSON
console.log(JSON.stringify(geoJsonData, null, 2));
read(wktText, label):
wktText
(string): The Well-Known Text string representing the geometries.label
(string): An optional label to associate with the geometries for identification or classification.toGeoJSON(dataArray):
FeatureCollection
.dataArray
(Object[]): The internal data array produced by the read
method, ready for transformation into GeoJSON format.GeoWKTer is licensed under the MIT License. For more details, please see the LICENSE file.
GeoWKTer is also inspired by the work of Wicket.js and Terraformer.
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址