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

    Function shapefileFromPath

    • Build a Shapefile from an input path

      Given a path to where all the shapefile relevant files exist, build a Shapefile

      Assumes the input is pointing to a shapefile or name without the extension. The algorithm will find the rest of the paths if they exist. May also be a gzipped folder.

      import { LambertConformalConic, EPSG_9974 } from 'gis-tools-ts';
      import { shapefileFromPath } from 'gis-tools-ts/mmap';

      const reader = await shapefileFromPath('path/to/files', [LambertConformalConic], { EPSG_9974 });

      for await (const feature of reader) {
      console.log(feature);
      }

      Parameters

      • input: string

        the path to the .shp file or name without the extension

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

      • a Shapefile