bjornharrtell / jsts

JavaScript Topology Suite
http://bjornharrtell.github.io/jsts/
Other
1.49k stars 232 forks source link

LinearRing isRing() function not working #492

Closed lfromeroa closed 1 year ago

lfromeroa commented 1 year ago

Hello,

There is a way to validate that a LinearRing is correctly constructed??? I'm trying to use isRing() function from LinearRing class but i get the following error:

TypeError: this.isSimple is not a function

The idea is to check if the LinearRing is not self intersected.

Thank you.

bjornharrtell commented 1 year ago

I think that is a bug. But I'm not sure it would give you the answer you want even if it worked. Instead you could use the IsValidOp operation (https://github.com/bjornharrtell/jsts/blob/master/src/org/locationtech/jts/operation/valid/IsValidOp.js#L100).

bjornharrtell commented 1 year ago

Fix in upstream patch https://github.com/bjornharrtell/jts/commit/864dd8527ed4a9eca93d80e8f1da0ce4a4f405ee.