-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsts.operation.overlay.OverlayOp.difference fails silently with the following geometries #525
Comments
Perhaps it's hitting a path that is highly inefficient as ported JavaScript, so that it will simply run "forever". Will require a substantial effort to get to the root cause and might be difficult to fix, so it's not likely I will be able to help in short term. A first step would be to compare with upstream, both with the version that the port is based on and newer. Assuming latest upstream work I would and you need to resolve this quicker I would suggest to do this kind of calculation serverside using upstream. |
@bjornharrtell thanks for the quick response. Is there a potential workaround? Like splitting the geometry into smaller parts and do the calculation step by step? I cannot do it Server side, it must run on the client. |
I do not think that will help. No immediate solution comes to mind, but I do wonder if your use case really needs this perhaps you can rethink. |
@bjornharrtell what do you mean by „if my use case really needs this“. My (offline) application displays the path a user took. If you drive from lets New York to Washington, that is the path I want to display. Not sure how I can work around this. The strange thing is: when I try to run the difference algorithm with a waaaaay more complex cover geometry, it works like a charm. |
Well, why do you need it cut out to display it? Anyway it's surely possible find out the root cause if you dig deep enough. |
@bjornharrtell Because that is what my app needs to do :) I will play around with it and let you know if I find sth out! Thanks for your help! |
Thanks for the awesome library. I think I have run into a bug.
I have this cover geometry
And this is the geometry I want to substract from it
This is the code I am using, which works with all of my other substract geometries, but not with the one above.
Now. this line
const difference = jsts.operation.overlay.OverlayOp.difference(coverJsts, geometryJsts)
fails silently. It never finishes, never produces an error, never produces an output and I cannot see any reason. If needed, I can provide different geometries of similar shape with which I do not encounter this problem.Here, a visualisation of
substractGeojson
andcoverGeojson
done on geojson.io.coverGeojson (basically a geometry that covers the whole world)
substractGeojson (the 'path' I want to stencil into the cover)
I am using
jsts: 2.11.0
The text was updated successfully, but these errors were encountered: