@envisim/geojson

0.1.1 • Public • Published

npm package

@envisim/geojson

A TypeScript library that provides functionality for working with GeoJSON data.

Installation

npm install @envisim/geojson

Usage

Example of creating a GeoJSON Line feature:

import { Feature, LineString } from "@envisim/geojson";

// Create a LineString, from a vector of coordinates ([Longitude, Latitude] pairs)
const lineString = LineString.create([
  [10, 20],
  [10, 30],
]);

// Calculate the length of the linstering
lineString.length();

// Create properties for the feature
const properties = {
  value: 123,
};

// Create a Feature instance
const lineFeature = new Feature(lineString, properties);

// Get the measure of the geometry
lineFeature.measure();

See also

Readme

Keywords

Package Sidebar

Install

npm i @envisim/geojson

Homepage

envisim.se

Weekly Downloads

84

Version

0.1.1

License

AGPL-3.0-only

Unpacked Size

163 kB

Total Files

71

Last publish

Collaborators

  • wpmg