Convert GPX to GeoJSON incrementally, returning a Generator that yields output feature by feature.
Convert a KML document to GeoJSON. The first argument, doc
, must be a KML
document as an XML DOM - not as a string. You can get this using jQuery's default
.ajax
function or using a bare XMLHttpRequest with the .response
property
holding an XML DOM.
The output is a JavaScript object of GeoJSON data. You can convert it to a string with JSON.stringify or use it directly in libraries.
Convert KML to GeoJSON incrementally, returning a Generator that yields output feature by feature.
Yield a nested tree with KML folder structure
This generates a tree with the given structure:
{
"type": "root",
"children": [
{
"type": "folder",
"meta": {
"name": "Test"
},
"children": [
// ...features and folders
]
}
// ...features
]
}
GroundOverlay elements are converted into
Feature
objects with Polygon
geometries,
a property like:
{
"@geometry-type": "groundoverlay"
}
And the ground overlay's image URL in the href
property. Ground overlays will need to be displayed
with a separate method to other features, depending
on which map framework you're using.
Convert a TCX document to GeoJSON. The first argument, doc
, must be a TCX
document as an XML DOM - not as a string.
Incrementally convert a TCX document to GeoJSON. The
first argument, doc
, must be a TCX
document as an XML DOM - not as a string.
Generated using TypeDoc
Convert a GPX document to GeoJSON. The first argument,
doc
, must be a GPX document as an XML DOM - not as a string. You can get this using jQuery's default.ajax
function or using a bare XMLHttpRequest with the.response
property holding an XML DOM.The output is a JavaScript object of GeoJSON data, same as
.kml
outputs, with the addition of a_gpxType
property on eachLineString
feature that indicates whether the feature was encoded as a route (rte
) or track (trk
) in the GPX document.