JavaScript implementation of Ray Geometry Topology (RayGT).
This package provides utilities to convert between GeoJSON geometries and RayGT flat numeric topology format.
npm install raygtimport { 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 ) )- fromGeoJSONPoint
- fromGeoJSONMultiPoint
- fromGeoJSONLineString
- fromGeoJSONMultiLineString
- fromGeoJSONPolygon
- fromGeoJSONMultiPolygon
- fromGeoJSONGeometry
- toGeoJSONPoint
- toGeoJSONMultiPoint
- toGeoJSONLineString
- toGeoJSONMultiLineString
- toGeoJSONPolygon
- toGeoJSONMultiPolygon
- toGeoJSONGeometry
Full format definition: