Skip to content

sharedstreets/sharedstreets-geojson

Repository files navigation

SharedStreets GeoJSON

npm version Build Status

Converts SharedStreets JSON to GeoJSON.

Install

In Node.js

$ yarn add sharedstreets-geojson

CommonJS

const sharedstreetsGeoJSON = require('sharedstreets-geojson');

Typescript

import * as sharedstreetsGeoJSON from 'sharedstreets-geojson';

In Browser

For a full list of web examples, check out SharedStreets examples.

API

Table of Contents

geometry

Geometry

Parameters

  • geom SharedStreetsGeometry JSON SharedStreetsGeometry

Examples

const line = [[110, 45], [115, 50], [120, 55]];
const geom = sharedstreets.geometry(line);
const geojson = sharedstreetsGeoJSON.geometry(geom)));
geojson // => Feature<LineString, SharedStreetsGeometry>

Returns Feature<LineString, SharedStreetsGeometry> GeoJSON LineString Feature SharedSteetsGeometry

intersection

Intersection

Parameters

  • intersect SharedStreetsIntersection JSON SharedStreetsIntersection

Examples

const pt = [110, 45];
const intersect = sharedstreets.intersection(pt);
const geojson = sharedstreetsGeoJSON.intersection(intersect)));
geojson // => Feature<Point, SharedStreetsIntersection>

Returns Feature<Point, SharedStreetsIntersection> GeoJSON Point Feature SharedSteetsIntersection

About

SharedStreets GeoJSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published