https://github.com/cspanring/flatlands
Transforms a 3D GeoJSON feature geometry to 2D.
https://github.com/cspanring/flatlands
Last synced: 3 months 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 (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-16T17:53:30.000Z (about 11 years ago)
- Last Synced: 2025-03-11T04:16:46.258Z (4 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flatlands
[](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]
]
]
]
}