@osmix/geoparquet
v0.1.7
Published
Import OSM data from GeoParquet files.
Readme
@osmix/geoparquet
Import GeoParquet files into Osmix. OpenStreetMap US publishes GeoParquet extracts with .
Installation
bun add @osmix/geoparquetUsage
import { fromGeoParquet } from "@osmix/geoparquet"
// From a local file buffer
const osm = await fromGeoParquet(await Bun.file('./monaco.parquet').arrayBuffer())
// Query imported data
const highways = osm.ways.search("highway")Layercake Format
Layercake is an OSM data distribution format created by OpenStreetMap US. It provides OSM data as GeoParquet files with the following schema:
id: OSM entity ID (bigint)geometry: WKB-encoded geometrytags: JSON object with OSM tags
This package reads these files using hyparquet and converts them to Osmix's in-memory format for spatial queries and analysis.
API
fromGeoParquet(source, options?, onProgress?)
Create an Osm index from GeoParquet data.
Parameters:
source- File path, URL, or ArrayBuffer containing parquet dataosmOptions- Optional Osm configuration (id, header)readOptions- Optional GeoParquet read optionsonProgress- Optional callback for progress updates
Returns: Promise - Populated Osm index with built indexes
