Greasy Fork is available in English.
GeoGMLer is a JavaScript library for converting GML data into GeoJSON. It translates FeatureMembers with Points, LineStrings, and Polygons, handling coordinates via gml:coordinates and gml:posList. Supports multi-geometries to ensure conversion to GeoJSON's FeatureCollection.
此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.org/scripts/526229/1537672/GeoGMLer.js
GeoGMLer is a JavaScript library designed to efficiently convert GML (Geography Markup Language) data into GeoJSON format. It supports a wide range of GML geometries, making it ideal for integrating GML spatial data into web mapping applications and geographic data visualization tools.
This project is licensed under the MIT License. See the LICENSE file for more details.
GeoGMLer offers a comprehensive API to parse GML files and convert them into a GeoJSON FeatureCollection
. It is suitable for use in geographic data visualization and web mapping applications, providing support for various geometry types and coordinate reference systems.
gml:MultiCurve
and gml:MultiSurface
into GeoJSON.To use GeoGMLer, create an instance of GeoGMLer
and utilize its methods to perform conversions from GML strings to GeoJSON objects.
var geoGMLer = new GeoGMLer(); // Create a new instance of GeoGMLer
// Sample GML data input
const gmlData = `...GML data string...`;
// Parse the GML data
const { xmlDoc, crsName } = geoGMLer.read(gmlData);
// Convert to GeoJSON
const geoJson = geoGMLer.toGeoJSON({ xmlDoc, crsName });
console.log(geoJson);
The structure and logic for this project are based on established methods for converting XML to GeoJSON, utilizing modern JavaScript practices for handling geographic data.
Project was inspired by the work of gml2geojson (MIT licensed) and builds upon the concepts and implementations found there.