Skip to main content

Geospatial columnar format

GeoArrow

GeoArrow defines the Arrow extension metadata and layouts that let geospatial features travel with typed attribute columns. It is a convention on top of Arrow, so a valid GeoArrow table remains an Arrow table.

loaders.gl support​

GeoArrow table map example

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.

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

Scan supported

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.

CapabilitySupport
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.

AreaCapabilityStatusAPI, guarantee, or boundary
IndexStable string, numeric, and bigint IDs✅ SupportedgetFeatureRowsById() preserves duplicate rows and distinguishes typed IDs
IndexNull geometry by ID✅ SupportedNonspatial rows remain addressable; they never match spatial predicates
IndexGeometry bounds and sliced vectors✅ SupportedRow-relative bounds are computed once; sorted minimum-X candidates prune extent queries
SelectionBounding-box extent candidates✅ SupportedgetFeatureRowsInExtent(); fast inclusive bounds test may return geometry false positives
SelectionExact coordinate intersection✅ SupportedgetFeatureRowsAtCoordinate(); actual point, line, or filled-polygon intersection
SelectionExact rectangle intersection✅ SupportedgetFeatureRowsIntersectingExtent() removes bounds false positives
SelectionPolygon holes and concavity✅ SupportedHole interiors excluded, outer and hole boundaries included
SelectionPoint, line, polygon, multipart, and collections✅ SupportedRecursively refines all simple-feature families
SelectionDegenerate query extents✅ SupportedPoint and line extents use the same closed-boundary rules
SelectionEmpty and null geometry✅ SupportedExcluded from spatial matches; empty result is an empty row array
NearestNearest geometry and snapped coordinate✅ SupportedgetClosestFeature() returns row, coordinate, and planar distance
NearestInclusive distance limit and row filter✅ SupportedmaxDistance and optional predicate; ties choose the earliest row
NearestPolygon interiors and holes✅ SupportedFilled interior distance is zero; hole queries find a ring boundary
EncodingNative geometry, WKB, and WKT queries✅ SupportedNative/WKB candidate decoding; WKT normalized to WKB once during index construction
CoordinatesXY with Z/M retained in stored geometry✅ SupportedSpatial predicates and distances use XY only
CoordinatesGeodesic distance, wrapping, reprojection❌ Not implemented by indexSupply data and queries in the same planar CRS
PrecisionAdaptive-precision topology and tolerance predicates❌ Not implementedStandard floating-point segment/ring calculations; no implicit snapping tolerance
SnappingPixel tolerance, vertex-only policy, segment intersection snapping❌ Not implemented by indexReturned closest coordinates are geometry based; application controls UI policies
LifecycleIncremental edits and change events❌ Not implementedTreat buffers as immutable and rebuild the index after mutation
ScalingMutable R-tree or persistent spatial index❌ Not implementedCurrent bounds index may inspect every row in the worst case
AnalysisArbitrary geometry predicates, spatial joins, buffers, topology❌ Not implemented by indexExact APIs cover coordinate/rectangle intersections; use a spatial engine for richer operations
Query integrationPortable relational scan/query✅ Supported separatelyArrow table predicates, projection, ordering, aggregates, unions, and joins
Query integrationExact predicate pushdown in generic Arrow scan❌ Not implementedUse this index explicitly to select geometry rows

Geometry Types​

Geometry typeReadWriteDescription
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:

PreferenceResultUse it when
geoarrow.wkbA binary geometry column with geoarrow.wkb metadataYou need compact, compatible interchange or persistence. This is the default for loaders.
geoarrow.geometryA stable geoarrow.geometry dense unionYou need one schema that can represent mixed geometry families, including collections.
optimizedA concrete native encoding for homogeneous data, otherwise geoarrow.geometryYou 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 sourceArrow outputPreference location
GeoJSONgeojson.shape: 'arrow'geoarrow.encodingPreference
CSVcsv.shape: 'arrow' and csv.detectGeometryColumns: truegeoarrow.encodingPreference
Shapefileshp.shape: 'arrow' or shapefile.shape: 'arrow'geoarrow.encodingPreference (legacy shp.geoarrowEncoding is also supported)
FlatGeobuf, GeoPackageLoader-specific Arrow shapegeoarrow.encodingPreference
KML, GPX, TCXLoader-specific Arrow shapegeoarrow.encodingPreference
MVT, MLT, PMTiles/TableTilerTile or source Arrow tablegeoarrow.encodingPreference
ArcGIS, WFS, OGC APIFeature or streamed Arrow tablegeoarrow.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.