# @geoarrow/geoarrow-js

> TypeScript implementation of GeoArrow

Latest version **0.3.3** (published 2025-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @geoarrow/geoarrow-js
pnpm add @geoarrow/geoarrow-js
yarn add @geoarrow/geoarrow-js
bun add @geoarrow/geoarrow-js
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2025-10-27 |
| First published | 2023-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 38 |
| Author | Kyle Barron |
| Maintainers | kylebarron |

## Links

- npm: https://www.npmjs.com/package/@geoarrow/geoarrow-js
- Repository: https://github.com/geoarrow/geoarrow-js
- Homepage: https://github.com/geoarrow/geoarrow-js#readme
- Issues: https://github.com/geoarrow/geoarrow-js/issues
- npm.io page: https://npm.io/package/@geoarrow/geoarrow-js

## Dependencies (3)

- [proj4](https://npm.io/package/proj4.md) ^2.9.2
- [threads](https://npm.io/package/threads.md) ^1.7.0
- [@math.gl/polygon](https://npm.io/package/@math.gl/polygon.md) ^4.0.0

## Recent versions

- 0.3.3 (latest) — 2025-10-27
- 0.3.2 — 2025-02-10
- 0.3.1 — 2024-06-25
- 0.3.0 — 2024-01-22
- 0.3.0-beta.1 — 2023-12-01
- 0.2.0 — 2023-11-30
- 0.1.0 — 2023-11-22

## README

# `geoarrow-js`

A minimal TypeScript implementation of [GeoArrow](https://geoarrow.org/) building on top of [Arrow JS](https://arrow.apache.org/docs/js/index.html).

It complements the work-in-progress [`geoarrow-wasm`](https://github.com/geoarrow/geoarrow-rs/tree/main/js), which will provide Rust-based operations on GeoArrow memory.

## Features

- Performant spatial operations.
- Rich static typing of geometry arrays.
- Tree shakeable.
- Utilities for sharing Arrow data across Web Workers (not specific to GeoArrow)

## Spatial operations

Only spatial operations that are implemented on binary representations of geometry will be added to this repo.

This means that `geoarrow-js` will not, say, use algorithms from [Turf](https://turfjs.org/), because that would require conversions to and from GeoJSON for the operation.

### Implemented algorithms:

Refer to the [`algorithm` namespace](https://geoarrow.github.io/geoarrow-js/modules/algorithm.html) in the docs.

- Polygon area and signed area (via [`@math.gl/polygon`](https://github.com/visgl/math.gl))
- Polygon winding order (via [`@math.gl/polygon`](https://github.com/visgl/math.gl))
- Polygon triangulation (via [`@math.gl/polygon`](https://github.com/visgl/math.gl), a fork of [`earcut`](https://github.com/mapbox/earcut).)
- Coordinate reprojection (via [`proj4`](https://github.com/proj4js/proj4js))
- Total bounds (the bounding box of an array of geometries).

## Web Worker utilities

Refer to the [`worker` namespace](https://geoarrow.github.io/geoarrow-js/modules/worker.html). Use `preparePostMessage` to obtain references to all underlying `ArrayBuffer` objects, so they can be transfered instead of copied.

```ts
import * as arrow from "apache-arrow";
import {
  preparePostMessage,
  rehydrateVector,
} from "@geoarrow/geoarrow-js/worker";

const originalVector = arrow.makeVector(new Int32Array([1, 2, 3]));
const [preparedVector, arrayBuffers] = preparePostMessage(originalVector);

// Here we use structuredClone to simulate a postMessage but on the main thread
const receivedVector = structuredClone(preparedVector, {
  transfer: arrayBuffers,
});
const rehydratedVector = rehydrateVector(receivedVector);
```

## Ecosystem

`geoarrow-js` is designed to be used seamlessly with WebAssembly-based GeoArrow operations, such as those in the JavaScript bindings of the Rust GeoArrow implementation, and with rendering libraries, such as [deck.gl](https://deck.gl/), with the help of [`@geoarrow/deck.gl-layers`](https://github.com/geoarrow/deck.gl-layers).

For more background on my plans for GeoArrow ecosystem in JS and WebAssembly, refer to [this thread](https://github.com/geoarrow/geoarrow-rs/issues/283).

---
_Source: https://npm.io/package/@geoarrow/geoarrow-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
