Skip to main content

KML module · loader API

KMLLoader

Parse KML geographic documents into loaders.gl geometry tables, preserving the feature-oriented structure needed for maps and Earth-browser content.

What it returns

Turn geographic documents into reusable data.

KMLLoader maps KML features into the common geometry-table family, giving applications a predictable handoff from document parsing to rendering or analysis.

Default

GeoJSONTable for application code

Rows

Object-row table for inspection

Columns

Arrow Table with WKB geometry

Document

Styles, folders, links, and views in KML

Detailed guide

KMLLoader reference

The sections below document imports, output shapes, options, and runtime limitations.

The KMLLoader parses KML files into loaders.gl geometry tables.

Usage​

import {KMLLoader} from '@loaders.gl/geospatial/kml';
import {load} from '@loaders.gl/core';

const data = await load(url, KMLLoader, options);

Shapes​

KMLLoader returns Apache Arrow Table objects by default. Set kml.shape to select another table representation.

ShapeOutput
geojson-tableloaders.gl GeoJSON table
object-row-tableloaders.gl row table with GeoJSON features
arrowApache Arrow Table with WKB geometry

Options​

OptionTypeDefaultDescription
kml.shapestring'arrow'Selects the returned table shape.

Limitations​

  • The loader interprets KML coordinates as WGS84 longitude/latitude (OGC:CRS84).