observable-framework-lib-shapefile
Library: Shapefile
Observable Framework documentation: Library: Shapefile Source: https://observablehq.com/framework/lib-shapefile
The ESRI shapefile is a binary format for geometry. Shapefiles are often paired with dBASE table files for metadata. You can use the shapefile module to convert shapefiles to GeoJSON for use with libraries such as D3, Observable Plot, and Leaflet. To import the shapefile module:
import * as shapefile from "npm:shapefile";
Then, to read a .shp and .dbf file:
const collection = shapefile.read(
...(await Promise.all([
FileAttachment("ne_110m_land/ne_110m_land.shp").stream(),
FileAttachment("ne_110m_land/ne_110m_land.dbf").stream()
More from spqw/skill-observable-framework
observable-framework-lib-deckgl
Using Deck.gl in Observable Framework for large-scale geospatial data visualization.
11observable-framework-lib-mapbox-gl
Using Mapbox GL JS in Observable Framework for vector tile maps.
4observable-framework-jsx
Using JSX (React components) in Observable Framework pages.
3observable-framework-embeds
How to embed Observable Framework pages and components into other websites.
3observable-framework-input-range
Range slider input component in Observable Framework — select a numeric value.
3observable-framework-lib-tex
Using TeX/LaTeX in Observable Framework for mathematical typesetting.
3