Given a collection of files, build a Shapefile
import { LambertConformalConic, EPSG_9974 } from 'gis-tools-ts';import { shapefileFromDefinition } from 'gis-tools-ts/file'; // Or 'gis-tools-ts/mmap' if you are using Bunimport type { Definition } from 'gis-tools-ts';const def: Definition = { shp: 'path/to/file.shp', dbf: 'path/to/file.dbf', prj: 'path/to/file.prj', cpg: 'path/to/file.cpg'};const reader = await shapefileFromDefinition(def, [LambertConformalConic], { EPSG_9974 });for await (const feature of reader) { console.log(feature);} Copy
import { LambertConformalConic, EPSG_9974 } from 'gis-tools-ts';import { shapefileFromDefinition } from 'gis-tools-ts/file'; // Or 'gis-tools-ts/mmap' if you are using Bunimport type { Definition } from 'gis-tools-ts';const def: Definition = { shp: 'path/to/file.shp', dbf: 'path/to/file.dbf', prj: 'path/to/file.prj', cpg: 'path/to/file.cpg'};const reader = await shapefileFromDefinition(def, [LambertConformalConic], { EPSG_9974 });for await (const feature of reader) { console.log(feature);}
a description of the data to parse
optional array of ProjectionTransformDefinitions to insert
a record of EPSG codes to use for the transformer if needed
Build a Shapefile from a Definition
Description
Given a collection of files, build a Shapefile
Usage