Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cspanring/flatlands
Transforms a 3D GeoJSON feature geometry to 2D.
https://github.com/cspanring/flatlands
Last synced: about 1 month ago
JSON representation
Transforms a 3D GeoJSON feature geometry to 2D.
- Host: GitHub
- URL: https://github.com/cspanring/flatlands
- Owner: cspanring
- Created: 2014-06-16T17:48:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-16T17:53:30.000Z (over 10 years ago)
- Last Synced: 2024-12-04T20:49:23.756Z (about 2 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flatlands
[![Build Status](https://travis-ci.org/cspanring/flatlands.svg)](https://travis-ci.org/cspanring/flatlands)
Transforms a 3D GeoJSON feature geometry to 2D.
## Usage
var flatlands = require('flatlands');
var multipolygon = {
"type": "MultiPolygon",
"coordinates": [
[
[
[102.0, 2.0, 0],
[103.0, 2.0, 0],
[103.0, 3.0, 0],
[102.0, 3.0, 0],
[102.0, 2.0, 0]
]
],
[
[
[100.0, 0.0, 0],
[101.0, 0.0, 0],
[101.0, 1.0, 0],
[100.0, 1.0, 0],
[100.0, 0.0, 0]
],
[
[100.2, 0.2, 0],
[100.8, 0.2, 0],
[100.8, 0.8, 0],
[100.2, 0.8, 0],
[100.2, 0.2, 0]
]
]
]
};var feature = flatlands(multipolygon);
Returns:
{
"type": "MultiPolygon",
"coordinates": [
[
[
[102, 2],
[103, 2],
[103, 3],
[102, 3],
[102, 2]
]
],
[
[
[100, 0],
[101, 0],
[101, 1],
[100, 1],
[100, 0]
],
[
[100.2, 0.2],
[100.8, 0.2],
[100.8, 0.8],
[100.2, 0.8],
[100.2, 0.2]
]
]
]
}