https://github.com/springmeyer/shapely.js
Node.js geometry library
https://github.com/springmeyer/shapely.js
Last synced: 4 months ago
JSON representation
Node.js geometry library
- Host: GitHub
- URL: https://github.com/springmeyer/shapely.js
- Owner: springmeyer
- License: bsd-2-clause
- Created: 2013-11-15T22:43:39.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-12T03:15:00.000Z (over 12 years ago)
- Last Synced: 2025-09-08T23:42:04.624Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 230 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shapely.js
Node.js geometry library. Bindings to [libgeos](http://trac.osgeo.org/geos/) using [node-ffi](https://github.com/rbranson/node-ffi). Inspired by [Shapely in python](http://toblerity.org/shapely/manual.html).
[](https://travis-ci.org/springmeyer/shapely.js)
EXPERIMENTAL ONLY. No current releases.
This is an investigation into these questions:
- How feasible is it to develop stable, cross platform, and reasonably fast node.js bindings to a C API using node-ffi, ref, ffi-generation, and node-weak?
- What does a good Javascript API look like that leverages libgeos but hides the complexity?
- How does an ffi-based approach perform compared to native calls in C++ or pure JS based geometry ops?
## Requires
- Node.js v0.10.x
- node-gyp [Dependencies](https://github.com/TooTallNate/node-gyp/#installation): python, make, c++ compiler
## Setup
To install:
git clone https://github.com/springmeyer/shapely.js.git
cd shapely.js
npm install
## Test
npm test
## Benchmarks
Working benchmarks at https://github.com/springmeyer/geom-ops-bench
## Details
At build time this module automatically generates raw libgeos ffi bindings (in `lib/geos.js`) using a [patched](https://github.com/springmeyer/node-ffi-generate/commit/eae6d9c2212486eb76979adc1d1ef98cb4e579b9) version of [node-ffi-generate](https://github.com/tjfontaine/node-ffi-generate). Then it provides a nascent wrapper to start making the API simpler (in `index.js`).
## See also
- Python ffi bindings to libgeos: http://toblerity.org/shapely/manual.html
- Ruby ffi bindings to libgeos: https://github.com/dark-panda/ffi-geos
- Pure JS geometry ops: https://github.com/maxogden/geojson-js-utils
- Pure JS geometry ops: https://github.com/chelm/shapely.js
- Node C++ bindings to libgeos: https://github.com/kashif/node-geos