https://github.com/sharedstreets/sharedstreets-geojson
SharedStreets GeoJSON
https://github.com/sharedstreets/sharedstreets-geojson
Last synced: 3 months ago
JSON representation
SharedStreets GeoJSON
- Host: GitHub
- URL: https://github.com/sharedstreets/sharedstreets-geojson
- Owner: sharedstreets
- License: mit
- Created: 2018-03-08T22:05:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-09T03:25:39.000Z (over 8 years ago)
- Last Synced: 2025-08-07T17:53:58.928Z (11 months ago)
- Language: TypeScript
- Size: 7.44 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# SharedStreets GeoJSON
[](https://badge.fury.io/js/sharedstreets-geojson)
[](https://travis-ci.org/sharedstreets/sharedstreets-geojson)
Converts SharedStreets JSON to GeoJSON.
## Install
**In Node.js**
```bash
$ yarn add sharedstreets-geojson
```
**CommonJS**
```js
const sharedstreetsGeoJSON = require('sharedstreets-geojson');
```
**Typescript**
```js
import * as sharedstreetsGeoJSON from 'sharedstreets-geojson';
```
## In Browser
For a full list of web examples, check out [SharedStreets examples](https://github.com/sharedstreets/sharedstreets-examples).
## API
#### Table of Contents
- [geometry](#geometry)
- [intersection](#intersection)
### geometry
Geometry
**Parameters**
- `geom` **SharedStreetsGeometry** JSON SharedStreetsGeometry
**Examples**
```javascript
const line = [[110, 45], [115, 50], [120, 55]];
const geom = sharedstreets.geometry(line);
const geojson = sharedstreetsGeoJSON.geometry(geom)));
geojson // => Feature
```
Returns **Feature<LineString, SharedStreetsGeometry>** GeoJSON LineString Feature SharedSteetsGeometry
### intersection
Intersection
**Parameters**
- `intersect` **SharedStreetsIntersection** JSON SharedStreetsIntersection
**Examples**
```javascript
const pt = [110, 45];
const intersect = sharedstreets.intersection(pt);
const geojson = sharedstreetsGeoJSON.intersection(intersect)));
geojson // => Feature
```
Returns **Feature<Point, SharedStreetsIntersection>** GeoJSON Point Feature SharedSteetsIntersection