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

    Function toJSONLD

    • Given a writer and an array of iterators, write the input features to the writer as JSON-LD

      Usage:

      import { toJSONLD, JSONReader } from 'gis-tools-ts';
      import { FileReader, FileWriter } from 'gis-tools-ts/file';
      // or use mmap reader if using bun
      // import { MMapReader } from 'gis-tools-ts/mmap';

      const fileReader = new FileReader(`${__dirname}/fixtures/points.geojson`);
      const jsonReader = new JSONReader(fileReader);
      const bufWriter = new FileWriter(`${__dirname}/fixtures/points.geojsonld`);
      const onFeature = (feature) => {
      feature.metadata = { id: feature.id };
      return feature;
      }

      // store to singular output
      await toJSONLD(bufWriter, [jsonReader], { projection: 'S2', buildBBox: true, onFeature });

      Parameters

      • writer: Writer

        the writer to apppend strings to

      • iterators: FeatureIterator<
            Record<string, unknown>,
            Properties,
            Properties,
            VectorGeometry<Properties>,
        >[]

        the collection of iterators to write

      • Optionalopts: ToJSONOptions

        user defined options [optional]

      Returns Promise<void>