raygt
v1.0.0
Published
JavaScript implementation of Ray Geometry Topology (RayGT)
Maintainers
Readme
RayGT
JavaScript implementation of Ray Geometry Topology (RayGT).
This package provides utilities to convert between GeoJSON geometries and RayGT flat numeric topology format.
Installation
npm install raygtBasic Example
import { fromGeoJSONGeometry, toGeoJSONGeometry } from "raygt"
const point = fromGeoJSONGeometry( {
type: "Point",
coordinates: [ 69.24, 41.31 ],
} )
console.log( point ) // [ 0, 2, 1, 1, 0, 1, 0, 1, 69.24, 41.31 ]
console.log( toGeoJSONGeometry( point ) )API
From GeoJSON
- fromGeoJSONPoint
- fromGeoJSONMultiPoint
- fromGeoJSONLineString
- fromGeoJSONMultiLineString
- fromGeoJSONPolygon
- fromGeoJSONMultiPolygon
- fromGeoJSONGeometry
To GeoJSON
- toGeoJSONPoint
- toGeoJSONMultiPoint
- toGeoJSONLineString
- toGeoJSONMultiLineString
- toGeoJSONPolygon
- toGeoJSONMultiPolygon
- toGeoJSONGeometry
Specification
Full format definition:
