Skip to content

Instantly share code, notes, and snippets.

@unicolet
Created May 28, 2012 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unicolet/2818482 to your computer and use it in GitHub Desktop.
Save unicolet/2818482 to your computer and use it in GitHub Desktop.
using jsts (Javascript Topology Suite) with nodejs
#!/usr/bin/nodejs
# run from jsts directory, the script expects lib to be a subdir of current dir
var i = require('./lib/javascript.util.js');
var j = require('./lib/jsts.js');
var geometryFactory = new jsts.geom.GeometryFactory();
var coordinate = new jsts.geom.Coordinate(1,2);
var point = geometryFactory.createPoint(coordinate);
console.log("Is it a valid point ? " + (new jsts.operation.valid.IsValidOp(point).isValid()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment