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

    Function shapefileFromURL

    • Read a Shapefile from a URL.

      Assumes the input is pointing to shapefile data or a gzipped folder with .shp, .dbf, .prj, and/or .cpg

      import { shapefileFromURL, LambertConformalConic, EPSG_9974 } from 'gis-tools-ts';

      const reader = await shapefileFromURL('https://example.com/data.zip', [LambertConformalConic], { EPSG_9974 });

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

      Parameters

      • url: string

        the url to the shapefile

      • Optionaldefs: typeof ProjectionBase[]

        optional array of ProjectionTransformDefinitions to insert

      • OptionalepsgCodes: 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