Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@geoarrow/geoarrow-js

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geoarrow/geoarrow-js

TypeScript implementation of GeoArrow

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
288
increased by53.19%
Maintainers
0
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 25 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc