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

Replace geojson-equality with a fresh implementation that fixes precision handling (boolean-equal / boolean-overlap) #2531

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

solarissmoke
Copy link
Contributor

@solarissmoke solarissmoke commented Nov 9, 2023

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Have read How To Contribute.
  • Run npm test at the sub modules where changes have occurred.
  • Run npm run lint to ensure code style at the turf module level.

A fresh implementation of geojson-equality, to fix a precision error and resolve #2530 .

I have put this new class in turf-helpers, and ported across all the tests from the upstream module, plus adding a new one to cover the precision handling.

Please let me know if I should move anything around.

@solarissmoke solarissmoke force-pushed the bugfix/2530-boolean-equal branch 7 times, most recently from 3f23efa to e3860f4 Compare November 10, 2023 07:06
@smallsaucepan
Copy link
Member

Thanks @solarissmoke. Have created a discussion #2537 to see if there is a better place than turf-helpers to put geojson-equality.

Apologies didn't address this before your PR - things are moving quite quickly. Will aim to merge this as is though (to avoid making work for you and get the bug resolved) and once we've decided we can refactor if need be.

Jump in on the discussion if you can. Would be good to get your thoughts.

Copy link
Member

@smallsaucepan smallsaucepan left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together @solarissmoke. As noted I get an error when using turf-helpers as a standalone package, which I think is because deep-equal isn't included as a dependency in turf-helpers/package.json

This is a bit of a gotcha because while everything builds and runs locally, when the package is published to NPM the dependency isn't included.

If you want to reproduce this you can follow the instructions in the wiki at https://github.com/Turfjs/turf/wiki/Contributing#deploy-to-a-local-node-registry to do a test publish on your local machine

@smallsaucepan
Copy link
Member

Hi @solarissmoke. Have just finished a bunch of build tool changes in turf master branch. Would you be able to bring your branch up to date with those changes, and then we can get this PR merged back to Turf?

Feel I kept you waiting so if you want a hand with any conflicts let me know. I think most changes are to package.json files, etc rather than index.ts. And we now build with pnpm instead of yarn.

@solarissmoke solarissmoke force-pushed the bugfix/2530-boolean-equal branch 2 times, most recently from fb9bc65 to d53aa05 Compare December 21, 2023 04:19
@solarissmoke
Copy link
Contributor Author

@smallsaucepan rebased - please double-check that the changes to the lock file look sensible.

Copy link
Member

@smallsaucepan smallsaucepan left a comment

Choose a reason for hiding this comment

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

Had some issues running locally @solarissmoke. Approving changes to get them into the CI pipeline and a consistent environment. We can tweak from there if need be 👍

packages/turf-helpers/test.ts Show resolved Hide resolved
@smallsaucepan
Copy link
Member

Hi @solarissmoke. The CI build had an error. Would you mind taking a look? Looks like a linting problem:

https://github.com/Turfjs/turf/actions/runs/7283948261/job/19881689391#step:7:40

Is pnpm test running for you locally?

@solarissmoke solarissmoke force-pushed the bugfix/2530-boolean-equal branch from d53aa05 to 5a47534 Compare December 22, 2023 02:34
@solarissmoke
Copy link
Contributor Author

@smallsaucepan please try running the workflow again - both test and lint issues should now be fixed.

@solarissmoke
Copy link
Contributor Author

@smallsaucepan I've no idea what is now causing the build to fail (I can't reproduce it locally - pnpm install --frozen-lockfile runs successfully for me). Would be grateful if you have any ideas.

@smallsaucepan
Copy link
Member

The tests have passed in CI. For future reference you also need to run pnpm test - that will run the linter and the unit tests.

Will get this merged and hopefully out in the next alpha! Thanks for sticking with this @solarissmoke. Appreciate your help with it.

@smallsaucepan smallsaucepan merged commit d0f5cd7 into Turfjs:master Dec 22, 2023
3 checks 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.

booleanEqual check does not properly handle precision
2 participants