gis-tools-ts - v0.6.0
    Preparing search index...

    Function shapefileFromDefinition

    • Build a Shapefile from a Definition

      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 Bun
      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);
      }

      Parameters

      • def: Definition

        a description of the data to parse

      • defs: typeof ProjectionBase[] = []

        optional array of ProjectionTransformDefinitions to insert

      • epsgCodes: Record<string, string> = {}

        a record of EPSG codes to use for the transformer if needed

      Returns Promise<ShapeFileReader<Record<string, unknown>, Properties, Properties>>

      • a Shapefile