public
Created

using jsts (Javascript Topology Suite) with nodejs

  • Download Gist
jsts_with_nodejs.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12
#!/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()));

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.