0.1.2 • Published 5 months ago
@envisim/geojson v0.1.2
@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();