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

Default add() arguments to zero-width rects? #42

Closed
mootari opened this issue Apr 28, 2022 · 4 comments
Closed

Default add() arguments to zero-width rects? #42

mootari opened this issue Apr 28, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@mootari
Copy link

mootari commented Apr 28, 2022

Flatbush is often used to index points, i.e., zero-width rectangles.

How do you feel about changing the signature of add to

add(minX, minY, maxX = minX, maxY = minY)

as a minor DX improvement for point indexing, so that repeating the coordinates can be avoided in this case?

@mootari mootari changed the title Default add() to zero-width rects? Default add() arguments to zero-width rects? Apr 28, 2022
@mootari
Copy link
Author

mootari commented Apr 28, 2022

Related: #33

@mourner mourner added the enhancement New feature or request label Apr 28, 2022
@mourner
Copy link
Owner

mourner commented Apr 28, 2022

Yeah, this makes sense! Let's make sure benchmarks don't show a regression (v8 can be weird sometimes) but if not, let's do it.

@paddymul
Copy link

I would like this feature too. I'm working to understand the RTree algorithm, and when the bounding rectangles are necessary for search vs the object stored. I added the #48 PR as a first step.

@paddymul
Copy link

Ahh. I think https://github.com/mourner/kdbush solves this usecase. @mourner Can you confirm? Thanks for the great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants