JSTS is a JavaScript library of spatial predicates and functions for processing geometry conforming to the Simple Features Specification for SQL published by the Open Geospatial Consortium. JSTS is also a JavaScript port of the well established Java library JTS with a built in parser for OpenLayers interopability.
JSTS is licensed with a dual BSD/EPL liceence. For more details go to the project page.
NOTE: OpenLayers specific code omitted. Please refer to this page for a complete example of usage with OpenLayers 3.
var reader = new WKTReader()
var a = reader.read('POINT (-20 0)')
var b = reader.read('POINT (20 0)')
a = BufferOp.bufferOp(a, 40)
b = BufferOp.bufferOp(40)
var intersection = OverlayOp.intersection(a, b)
var difference = OverlayOp.difference(a, b)
var union = UnionOp.union(a, b)
var symDifference = OverlayOp.symDifference(a, b)