Skip to content
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

Added proper priorityqueue #519

Merged
merged 2 commits into from
May 9, 2024
Merged

Conversation

doskabouter
Copy link
Contributor

No description provided.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should remain unchanged, the java PQ interface must be kept in place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current STRtree in jts also uses the import java.util.PriorityQueue... in fact you did that change yourself (locationtech/jts@ff638ee) :)
Or was that done after your last conversion from jts?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's direct from conversion, that is why I don't want any change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well when STRtree uses the old (deprecated) priorityqueue my testcase gets in that infinite loop...
and if I check https://github.com/locationtech/jts/blob/7ef2b9d2e6f36ce5e7a787cff57bd18281e50826/modules/core/src/main/java/org/locationtech/jts/index/strtree/STRtree.java#L20 it clearly states that the priorityqueue should be the java one and not the jts one...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes I see now and sorry for misleading. The problem is, unfortunately, that the conversion process do not work for recent verisons of JTS so JSTS is lagging behind. There are several unfortunate reasons for this, one of them is lack of time on my side but another is lacking upstream interest (IMHO).

I'm not sure what the best way to move forward here. Possibly it is to also supply the alternative implementation, manually, over the generated one at https://github.com/bjornharrtell/jsts/blob/master/src/org/locationtech/jts/util/PriorityQueue.js and then I can except that file from the conversion process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, clear... I saw that you even committed a change there to use the internal PriorityQueue...(locationtech/jts@941fb5d)

Do you need something from me (time/effort/whatever) to get this going forward? I'd really like to get this fixed so I can continue using this

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm completely forgot why I did that..

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doskabouter I've removed use of the internal PriorityQueue in the JTS 1.17 patched version and it seems to pass tests for that source, and I've regenerated to JSTS. You should try adapting this PR to that and see if it can work for your case. It would also be good with a test case that demonstrates that what is fixed by using a new PriorityQueue implementation.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry I see you already have a good test case added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot!
Need anything else from me?

@bjornharrtell bjornharrtell self-requested a review May 9, 2024 15:09
Copy link
Owner

@bjornharrtell bjornharrtell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will merge.

@bjornharrtell bjornharrtell merged commit 70ff1b6 into bjornharrtell:master May 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants