loaders.gl support
| Type | API |
|---|---|
| Loader | GeoArrowLoader |
| Utility | convertGeojsonToBinaryFeatureCollection |
| Utility | convertBinaryFeatureCollectionToGeojson |
| Utility | triangulateWKBGeometryColumn |
See Coordinate Reference Systems for GeoArrow CRS representations and column-specific metadata. The conformance ledger defines the supported physical matrix.
The GeoArrow boundary
Geometry columns stay Arrow columns.
GeoArrow adds geometry layouts and extension metadata to an ordinary Arrow table. The geometry travels with typed attributes instead of taking a separate application path.
Geospatial inputs
GeoArrow table
geometry · attributes · CRS metadata
GeoArrow is a convention on top of Arrow, so the result stays compatible with Arrow IPC and the broader Arrow ecosystem.
The GeoArrow path
Keep features and attributes in one typed table.
Geometry columns carry their encoding and extension metadata alongside ordinary Arrow fields. That lets table readers, scans, workers, and renderers share a columnar contract without inventing a second file format.
Geometry
Point, line, polygon, and collection layouts
Attributes
Typed Arrow columns for non-spatial feature data
Metadata
Extension type information and CRS definitions
Interop
Arrow IPC and the wider Arrow ecosystem
@loaders.gl/tables/arrow- loaders.gl implementation- GeoArrow Specification
- Apache Arrow - A specification for large in-memory columnar data.
- ArrowJS - loaders.gl documentation on ArrowJS API.
Overview
GeoArrow is a specification for storing geospatial data in Apache Arrow memory layout. It ensures geospatial tools can interoperate and leverage the growing Apache Arrow ecosystem.
Detailed guide
GeoArrow layout and metadata
The sections below describe geometry encodings, extension metadata, scan behavior, and loaders.gl support.
GeoArrow enables each row in an Arrow table to represent a feature as defined by the OGC Simple Feature Access standard (i.e. Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection).
Aside from geometry, simple features can also have additional standard Arrow columns that provide additional non-spatial attributes for the feature.
GeoArrow represents geospatial tabular data with one or more geometry columns and ordinary Arrow columns for feature attributes. The specification defines how those vector features can be stored in Arrow-compatible data structures.
Note that GeoArrow is not a separate format from Apache Arrow rather, the GeoArrow specification simply describes additional conventions for metadata and layout of geospatial data. This means that a valid GeoArrow file is always a valid Arrow file. This is done through Arrow extension type definitions that ensure type-level metadata (e.g., CRS) is propagated when used in Arrow implementations.
Scan support
GeoArrow tables use the same portable table query as ordinary Arrow tables. Geometry extension metadata remains attached to the projected fields; scanning does not imply coordinate transformation or a spatial index.
| Capability | Support |
|---|---|
| Schema and geometry-role discovery | ✅ Supported |
| Attribute predicates, projection, and limit | ✅ Supported |
| Expressions, ordering, aggregates, unions, and joins | ✅ Supported for in-memory tables |
| Geometry representation | ✅ Preserved when the selected columns retain it |
| Spatial predicate or spatial-index pushdown | ❌ Not provided by the generic Arrow executor |
| CRS transformation | ❌ Not performed |
Spatial query support
@loaders.gl/core/geoarrow provides geometry processing over materialized Arrow columns alongside
conversion and metadata tools. The index covers every supplied row, including offscreen features;
it is separate from screen picking.
| Area | Capability | Status | API, guarantee, or boundary |
|---|---|---|---|
| Index | Stable string, numeric, and bigint IDs | ✅ Supported | getFeatureRowsById() preserves duplicate rows and distinguishes typed IDs |
| Index | Null geometry by ID | ✅ Supported | Nonspatial rows remain addressable; they never match spatial predicates |
| Index | Geometry bounds and sliced vectors | ✅ Supported | Row-relative bounds are computed once; sorted minimum-X candidates prune extent queries |
| Selection | Bounding-box extent candidates | ✅ Supported | getFeatureRowsInExtent(); fast inclusive bounds test may return geometry false positives |
| Selection | Exact coordinate intersection | ✅ Supported | getFeatureRowsAtCoordinate(); actual point, line, or filled-polygon intersection |
| Selection | Exact rectangle intersection | ✅ Supported | getFeatureRowsIntersectingExtent() removes bounds false positives |
| Selection | Polygon holes and concavity | ✅ Supported | Hole interiors excluded, outer and hole boundaries included |
| Selection | Point, line, polygon, multipart, and collections | ✅ Supported | Recursively refines all simple-feature families |
| Selection | Degenerate query extents | ✅ Supported | Point and line extents use the same closed-boundary rules |
| Selection | Empty and null geometry | ✅ Supported | Excluded from spatial matches; empty result is an empty row array |
| Nearest | Nearest geometry and snapped coordinate | ✅ Supported | getClosestFeature() returns row, coordinate, and planar distance |
| Nearest | Inclusive distance limit and row filter | ✅ Supported | maxDistance and optional predicate; ties choose the earliest row |
| Nearest | Polygon interiors and holes | ✅ Supported | Filled interior distance is zero; hole queries find a ring boundary |
| Encoding | Native geometry, WKB, and WKT queries | ✅ Supported | Native/WKB candidate decoding; WKT normalized to WKB once during index construction |
| Coordinates | XY with Z/M retained in stored geometry | ✅ Supported | Spatial predicates and distances use XY only |
| Coordinates | Geodesic distance, wrapping, reprojection | ❌ Not implemented by index | Supply data and queries in the same planar CRS |
| Precision | Adaptive-precision topology and tolerance predicates | ❌ Not implemented | Standard floating-point segment/ring calculations; no implicit snapping tolerance |
| Snapping | Pixel tolerance, vertex-only policy, segment intersection snapping | ❌ Not implemented by index | Returned closest coordinates are geometry based; application controls UI policies |
| Lifecycle | Incremental edits and change events | ❌ Not implemented | Treat buffers as immutable and rebuild the index after mutation |
| Scaling | Mutable R-tree or persistent spatial index | ❌ Not implemented | Current bounds index may inspect every row in the worst case |
| Analysis | Arbitrary geometry predicates, spatial joins, buffers, topology | ❌ Not implemented by index | Exact APIs cover coordinate/rectangle intersections; use a spatial engine for richer operations |
| Query integration | Portable relational scan/query | ✅ Supported separately | Arrow table predicates, projection, ordering, aggregates, unions, and joins |
| Query integration | Exact predicate pushdown in generic Arrow scan | ❌ Not implemented | Use this index explicitly to select geometry rows |
Geometry Types
| Geometry type | Read | Write | Description |
|---|---|---|---|
geoarrow.point | ✅ | ✅ | |
geoarrow.multipoint | ✅ | ✅ | |
geoarrow.linestring | ✅ | ✅ | |
geoarrow.multilinestring | ✅ | ✅ | |
geoarrow.polygon | ✅ | ✅ | |
geoarrow.multipolygon | ✅ | ✅ | |
geoarrow.geometry | ✅ | ✅ | Dense union |
geoarrow.geometrycollection | ✅ | ✅ | List of dense unions |
geoarrow.box | ✅ | ✅ | |
geoarrow.wkb | ✅ | ✅ | WKB interchange |
geoarrow.wkt | ✅ | ✅ | WKT interchange |
Relationship with GeoParquet
The GeoParquet specification is closely related to GeoArrow. Notable differences:
- GeoParquet is a file-level metadata specification
- GeoArrow is a field-level metadata and memory layout specification
Metadata Evolution
@loaders.gl/core/geoarrow exposes mergeGeoArrowMetadata() for concatenation, projection, joins,
and derived columns. It unions geometry types in canonical order, preserves structurally equal
CRS and unknown metadata, and reports scalar conflicts. Use strict to reject unsafe claims,
permissive to retain the first value with a diagnostic, or repair to drop conflicting keys.
Conversion Paths
Choosing geometry encoding
Arrow-capable geospatial loaders accept a common encoding preference. The option is placed at
geoarrow.encodingPreference alongside the loader-specific options:
import {GeoJSONLoader} from '@loaders.gl/tables/geojson';
import {load} from '@loaders.gl/core';
const table = await load('cities.geojson', GeoJSONLoader, {
geojson: {shape: 'arrow'},
geoarrow: {encodingPreference: 'optimized'}
});
The three preferences have intentionally different guarantees:
| Preference | Result | Use it when |
|---|---|---|
geoarrow.wkb | A binary geometry column with geoarrow.wkb metadata | You need compact, compatible interchange or persistence. This is the default for loaders. |
geoarrow.geometry | A stable geoarrow.geometry dense union | You need one schema that can represent mixed geometry families, including collections. |
optimized | A concrete native encoding for homogeneous data, otherwise geoarrow.geometry | You want the best compute layout without choosing a geometry family in advance. |
optimized selects geoarrow.point, geoarrow.multipoint, geoarrow.linestring,
geoarrow.multilinestring, geoarrow.polygon, or geoarrow.multipolygon when the column is
homogeneous or contains only the corresponding single and multi family. Mixed columns and
unknown streaming inputs use the dense union. The union schema is fixed before the first batch;
it does not change when a later batch contains another geometry family.
Loader defaults remain geoarrow.wkb for compatibility. Scan uses optimized when a spatial
operation needs coordinates, and reuses that converted geometry batch for the rest of the plan.
Choosing a preference affects Arrow output only; it does not change the default GeoJSON, binary,
or row-table return values.
For controlled conversions, exact native targets remain available:
import {convertTableToGeoArrow} from '@loaders.gl/core/geoarrow';
const polygons = convertTableToGeoArrow(table, {
geoarrow: {encoding: 'geoarrow.polygon', coordinates: 'separated'}
});
const adaptive = convertTableToGeoArrow(table, {
geoarrow: {encodingPreference: 'optimized'}
});
encoding is for callers that know the target layout. encodingPreference is the portable
policy used by loaders and applications. Supplying both is an error. Exact targets can fail when
the input cannot be represented by that encoding; preferences may promote homogeneous single and
multi types or fall back to the dense union.
The preference does not discard table information. Geometry field metadata, CRS and edge
algorithm, XYZM dimensionality, separated or interleaved coordinate layout, offset width, nulls,
empty geometries, feature IDs, and non-geometry columns are preserved where the target encoding
supports them. Existing native GeoArrow input is retained for identity conversions. Use
coordinates: 'separated' or coordinates: 'interleaved' and offsetType: 'int32' or
offsetType: 'int64' when the physical layout must be controlled.
The preference is available on the Arrow-producing vector loaders and sources below. The loader-specific option controls the output shape; the common option controls only the geometry encoding.
| Loader or source | Arrow output | Preference location |
|---|---|---|
| GeoJSON | geojson.shape: 'arrow' | geoarrow.encodingPreference |
| CSV | csv.shape: 'arrow' and csv.detectGeometryColumns: true | geoarrow.encodingPreference |
| Shapefile | shp.shape: 'arrow' or shapefile.shape: 'arrow' | geoarrow.encodingPreference (legacy shp.geoarrowEncoding is also supported) |
| FlatGeobuf, GeoPackage | Loader-specific Arrow shape | geoarrow.encodingPreference |
| KML, GPX, TCX | Loader-specific Arrow shape | geoarrow.encodingPreference |
| MVT, MLT, PMTiles/TableTiler | Tile or source Arrow table | geoarrow.encodingPreference |
| ArcGIS, WFS, OGC API | Feature or streamed Arrow table | geoarrow.encodingPreference |
For CSV geometry detection, use csv.detectGeometryColumns: true together with the common
preference. For Shapefile, the legacy shp.geoarrowEncoding: 'geoarrow' option remains
supported and means optimized.
The lightweight format loaders only construct the requested Arrow geometry column. They do not
depend on the full @loaders.gl/core/geoarrow package. Install that package when you need conversion,
validation, bounds, coordinate iteration, or other processing APIs.
Use convertGeoArrowGeometry(table, 'native') when a table will be processed or rendered from
coordinates. The adaptive target selects concrete point, line, polygon, or multi-geometries for
homogeneous columns and uses geoarrow.geometry for genuinely mixed columns. Set
coordinates: 'separated' for one typed buffer per ordinate or offsetType: 'int64' for large
arrays.
Direct Arrow-buffer kernels cover the primary native, WKB, WKT, union, and box paths. Conversions
without a direct kernel retain the compatibility GeoJSON bridge by default. Set fallback: 'error'
to require a direct kernel in performance-sensitive code and fail instead of materializing objects.
WKB/WKT scalar columns may use standard, large, or Arrow view storage (Binary, LargeBinary,
BinaryView, Utf8, LargeUtf8, or Utf8View). Use @math.gl/core/arrow to isolate
sliced Arrow buffers and prepare tables for worker transfer.
WKB remains the compact interchange and persistence representation. WKT columns use direct state-machine and native-buffer paths in both directions: parsing numeric tokens into the GeoArrow builder and writing native coordinates without creating one GeoJSON object per feature. Mixed WKT columns and GeometryCollections use typed union kernels as well, without a GeoJSON materialization bridge. Recursive GeometryCollections remain valid in serialized WKB/WKT, but the GeoArrow native schema forbids them and native conversion rejects them.
Recursive collection decoding is bounded by maxGeometryCollectionDepth (64 by default) on
GeoArrowGeometryConvertOptions. Set a smaller limit for untrusted inputs; exceeding the limit
produces an actionable conversion error rather than allowing unbounded parser recursion.
The same options expose opt-in resource budgets for ingestion boundaries. maxGeometryBytes
limits the total WKB/WKT payload bytes in one converted vector, while maxGeometryVertices
limits the total coordinate vertices in one vector. Both budgets are checked before identity
returns and before native allocation, including when the requested target already matches the
source. They are useful for service and worker boundaries that accept untrusted geometry; normal
in-memory conversions remain unlimited unless a caller supplies a budget.
For streaming Arrow data, convertGeoArrowBatches() accepts and yields native Arrow
RecordBatch values. It preserves batch-local metadata and checks cancellation between batches. If a WKB/WKT stream has no trusted geometry_types metadata,
native conversion selects a stable dense union seeded with all seven geometry families and all
four dimensions. A later batch can therefore introduce a new family without changing the stream
schema or forcing an earlier batch through a row-object bridge.
mergeGeoArrowSchemas() provides the corresponding schema-evolution boundary for concatenation,
rechunking, projection, and derived columns. It checks physical Arrow compatibility, merges field
and GeoParquet metadata deterministically, and reports conflicts under strict, permissive, or
repair policy. Strict and repair modes remove conflicting extension claims instead of retaining
metadata that no longer describes the merged physical field.
