@geoarrow/geoarrow-js

中文文档
0.3.3发布于 2025/10/28MITTypeScriptESM + CJS近 30 天下载 8万

TypeScript implementation of GeoArrow

原始使用文档
文档目录5 节
  1. Features
  2. Spatial operations
  3. Implemented algorithms:
  4. Web Worker utilities
  5. Ecosystem

geoarrow-js

A minimal TypeScript implementation of GeoArrow building on top of Arrow JS.

It complements the work-in-progress geoarrow-wasm, 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, because that would require conversions to and from GeoJSON for the operation.

Implemented algorithms:

Refer to the algorithm namespace in the docs.

Web Worker utilities

Refer to the worker namespace. Use preparePostMessage to obtain references to all underlying ArrayBuffer objects, so they can be transfered instead of copied.

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, with the help of @geoarrow/deck.gl-layers.

For more background on my plans for GeoArrow ecosystem in JS and WebAssembly, refer to this thread.

版本与发布记录

@geoarrow/geoarrow-js 共发布 7 个版本,首次发布于 2023/11/23;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.3.3latest2025/10/281.1 年前
0.3.22025/02/111.8 年前
0.3.12024/06/252 年前
0.3.02024/01/222 年前
0.3.0-beta.12023/12/022 年前
0.2.02023/12/012 年前

关于 @geoarrow/geoarrow-js 的常见问题

@geoarrow/geoarrow-js 是什么?

TypeScript implementation of GeoArrow

如何安装 @geoarrow/geoarrow-js?

在项目目录运行 npm install @geoarrow/geoarrow-js,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:apache-arrow(>=15)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@geoarrow/geoarrow-js 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@geoarrow/geoarrow-js 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@geoarrow/geoarrow-js 可以商用吗?

@geoarrow/geoarrow-js 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@geoarrow/geoarrow-js 的下载量有多少?

根据 npm 官方下载统计,@geoarrow/geoarrow-js 在 2026/10/16 – 2026/11/14 这 30 天内被下载 80,432 次,日均约 2,681 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@geoarrow/geoarrow-js 还在维护吗?

最新版本 0.3.3 发布于 2025/10/28(1.1 年前);至今共发布 7 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/11/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。