bjornharrtell / jsts

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

Intersection with lines? #489

Closed abenrob closed 1 year ago

abenrob commented 1 year ago

I'm trying to do an intersection between lines and a polygon. It doesn't seem to work - am I doing something wrong, or are lines not supported in this operation?

https://observablehq.com/d/c0d6fd2f4d0174e0

bjornharrtell commented 1 year ago

Sorry but this is not a free support forum.

abenrob commented 1 year ago

I'm happy to contribute. A simple "line intersections are supported (yes/no)" would suffice to let me know if I should continue troubleshooting, or consider a feature add.

bjornharrtell commented 1 year ago

Yes it is supported. It looks like you are making wrong assumptions on how the API works, i.e you cannot pass on objects of "features" to intersection, it expects a single geometry (which could be a geometrycollection). You also seem to be using a very old version (1.1.1 is from 2016).

abenrob commented 1 year ago

Brilliant. I'm working with https://github.com/neocarto/geotoolbox as well, which is what brought me here in the first place. I'll see if I need to patch that based on your feedback.