Skip to content

Instantly share code, notes, and snippets.

@andrewharvey
Last active July 5, 2016 09:31
Show Gist options
  • Save andrewharvey/113d277ce9847cbc73251a2e59314364 to your computer and use it in GitHub Desktop.
Save andrewharvey/113d277ce9847cbc73251a2e59314364 to your computer and use it in GitHub Desktop.
JSTS Issue TypeError: this.seg.p1.equals2D is not a function https://github.com/bjornharrtell/jsts/issues/276
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/node
var jsts = require('jsts');
var reader = new jsts.io.GeoJSONReader();
var fs = require('fs');
var poly1 = JSON.parse(fs.readFileSync('a.geojson', 'utf8'));
var poly2 = JSON.parse(fs.readFileSync('b.geojson', 'utf8'));
var a = reader.read(JSON.stringify(poly1.geometry));
var b = reader.read(JSON.stringify(poly2.geometry));
var union = a.union(b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment