GeoGPXer is a JavaScript library designed to convert GPX data into GeoJSON format efficiently. It supports the conversion of waypoints, tracks, and routes, with additional handling for GPX extensions.
Script này sẽ không được không được cài đặt trực tiếp. Nó là một thư viện cho các script khác để bao gồm các chỉ thị meta
// @require https://update.greasyfork.org/scripts/523870/1614123/GeoGPXer.js
GeoGPXer is a JavaScript library designed to convert GPX data into GeoJSON format efficiently. It supports the conversion of waypoints, tracks, and routes, with additional handling for GPX extensions.
This project is free software licensed under the GNU LESSER GENERAL PUBLIC LICENS v3. See the LICENSE file for more details.
GeoGPXer provides an easy-to-use API to parse GPX files and convert them into a GeoJSON FeatureCollection, making it suitable for use in web mapping applications and geographic data visualization.
<extensions> to prefixed GeoJSON properties to avoid conflicts.To use GeoGPXer, create an instance of GeoGPXer and use its methods to perform the conversion from GPX strings to GeoJSON objects.
// @require https://update.greasyfork.org/scripts/523870/1534525/GeoGPXer.js
var geoGPXer = new GeoGPXer(); // Create a new instance of GeoGPXer
// Sample GPX data input
const gpxData = `...GPX data string...`;
// Parse the GPX data
const xmlDoc = geoGPXer.read(gpxData);
// Convert to GeoJSON
const geoJson = geoGPXer.toGeoJSON(xmlDoc);
console.log(geoJson);
The code in this project is derived from the logic of gpx2geojson by M-Reimer.