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

TWKB read and write implementation #854

Merged
merged 5 commits into from May 27, 2022
Merged

TWKB read and write implementation #854

merged 5 commits into from May 27, 2022

Conversation

murdos
Copy link
Contributor

@murdos murdos commented Mar 26, 2022

I continued previous work done with #452 and twkb branch.

What I've done:

  • removed lombok dependency
  • moved reader and writer to jts-io-common module, since TWKB is an external format, it's more logical to have it outside jts-core
  • split TWKBIO code into TWKBReader and TWKBWriter
  • aligned optimizations on PostGis 2.5+ behavior, and removed disabling/enabling optimization from writer API
  • regenerated tests data from postgis

@murdos
Copy link
Contributor Author

murdos commented May 4, 2022

@jnh5y : hey! Would you agree to sign the Eclipse agreement with the mail you used in the commits of the twkb branch (jnh5y@****.com)?

@dr-jts
Copy link
Contributor

dr-jts commented May 4, 2022

That's a lot of test data! How long does it take to run? Is there any way to slim it down to focus on just code coverage?

@jnh5y
Copy link
Contributor

jnh5y commented May 4, 2022

@murdos "yes", I'd be happy to sign the commits. That'd change the Git history.

My current ECA is under jnhuva@gmail.com. If you update the author for commits or mention that email things may go better.

FWIW, I'd be fine seeing this all merge-squashed into one commit. I think @jodygarnett would be ok with that as well.

@jnh5y
Copy link
Contributor

jnh5y commented May 4, 2022

Oh, @murdos I answered a different question. I cannot sign the ECA with that email address since I don't work at CCRI anymore. I had that email address when I first starting contributing...

@jnh5y
Copy link
Contributor

jnh5y commented May 4, 2022

Heheh, I agree with Martin, I think we can ditch the massive test files.:)

@murdos
Copy link
Contributor Author

murdos commented May 4, 2022

i've reduced test data to only 78 lines per csv, the whole twkb tests take ~500ms to run.

Initial work by James Hughes <jnhuva@gmail.com>, resumed by Jody Garnett <jody.garnett@gmail.com>, Gabriel Roldan <gabriel.roldan@gmail.com> and Aurélien Mino <aurelien.mino@gmail.com>
@murdos
Copy link
Contributor Author

murdos commented May 4, 2022

FWIW, I'd be fine seeing this all merge-squashed into one commit. I think @jodygarnett would be ok with that as well.

Do you mean something like this: https://github.com/locationtech/jts/compare/master...murdos:twkb-squashed?expand=1 ?
It's a bit hard to merge-squashed the whole branch history while keeping commits messages, since master has been merged a few times in that branch.

@dr-jts
Copy link
Contributor

dr-jts commented May 4, 2022

Do you mean something like this: https://github.com/locationtech/jts/compare/master...murdos:twkb-squashed?expand=1 ?

Yup, that's fine. It's going to get squashed on merge anyway.

Copy link
Contributor

@jodygarnett jodygarnett left a comment

Choose a reason for hiding this comment

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

I think this is okay, see comments below.

@dr-jts do we have any project standards on class javadocs to maintain?

* limitations under the License.
*
*
* Original file: https://svn.apache.org/repos/asf/mahout/branches/mahout-0.8/core/src/main/java/org/apache/mahout/math/Varint.java
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are making use of this file as provided, do we wish to also include the test case VarintTest.java?

This header looks fine and amounts to a dependency on Apache mahout version 0.8 (depending on source code rather than binary)

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 VarintTest has already been adapted by @groldan : https://github.com/locationtech/jts/pull/854/files#diff-9f94911887b807419c51762589f89bc8ecfdc48eb0b24c01d5919444c3c6acf2

IMO it's useful to have tests that verify behaviour of this utility class, but I'm not opposed to removing it, since it's unlikely that this code will evolve in jts.

@dr-jts
Copy link
Contributor

dr-jts commented May 18, 2022

@dr-jts do we have any project standards on class javadocs to maintain?

There's the CONTRIBUTING page.

Javadoc on classes is always nice, but for a small, clear, purely internal class perhaps it isn't needed.

@groldan
Copy link
Member

groldan commented May 19, 2022

Hey @murdos I'm so glad to see this work going forward. Unfortunately, I didn't have a chance to continue as it was all in spare time, which has been scarce to be polite. So thanks for picking it up.

@@ -0,0 +1,120 @@
CREATE OR REPLACE FUNCTION generate_twkb_test_data(
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to document how to use this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added some documentation, please let me know if there's other info you would like to know.

@jnh5y
Copy link
Contributor

jnh5y commented May 25, 2022

@jodygarnett any last minute concerns about the Javadocs? I'm hoping to be free enough on Friday to think about the JTS release.

@jnh5y jnh5y merged commit b3b97f6 into locationtech:master May 27, 2022
@murdos
Copy link
Contributor Author

murdos commented Jun 21, 2022

Hi @dr-jts. Do you have any ETA for the next jts release?

@dr-jts
Copy link
Contributor

dr-jts commented Jun 21, 2022

Very soon, I hope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants