🏠 Home 

GeoGMLer

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.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/526229/1537672/GeoGMLer.js


Ask a question, post a review, or report the script.
Author
JS55CT
Version
2.1.0
Created
2025-02-08
Updated
2025-02-15
Size
24.9 KB
License
MIT

GeoGMLer

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.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Overview

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.

Features

Usage

To use GeoGMLer, create an instance of GeoGMLer and utilize its methods to perform conversions from GML strings to GeoJSON objects.

Example

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);

Key Methods

Acknowledgments

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.

Project Home

https://github.com/YourUsername/GeoGMLer