Skip to main content

Shapefile module

Read the geometry and attributes that travel together.

@loaders.gl/geospatial/shapefile loads the familiar .shp geometry and companion attribute files into geospatial table data. Use the archive loader for a complete dataset or the lower-level SHP loader for geometry-only input.

The Shapefile path

Read the dataset pieces. Join them into usable features.

Shapefile is a small family of related files. The high-level loader coordinates the pieces so application code can work with geometry and properties together.

Input

Shapefile archive or individual `.shp` data

Geometry

Points, lines, polygons, and multipart records

Attributes

DBF properties and optional projection metadata

Output

Geospatial table data

Detailed guide

Loader and file-part details

The reference below covers installation, the complete archive loader, the geometry-only loader, companion files, and geospatial output.

The @loaders.gl/geospatial/shapefile module handles the Shapefile format, a widely used binary format.

Installation​

npm install @loaders.gl/geospatial

Loaders and Writers​

LoaderDescription
ShapefileLoaderLoads Shapefile archives as geospatial tables.
SHPLoaderLoads individual Shapefile .shp geometry files.

Attribution​

The Shapefile loaders were written from scratch for loaders.gl.