Given a collection of files, build a Shapefile
import { LambertConformalConic, EPSG_9974 } from 'gis-tools-ts';import { shapefileFromDefinition } from 'gis-tools-ts/mmap';import 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/mmap';import 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
Build a Shapefile from a Definition
Description
Given a collection of files, build a Shapefile
Usage