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

non-root bbox #21

Closed
calvinmetcalf opened this issue Dec 4, 2013 · 5 comments
Closed

non-root bbox #21

calvinmetcalf opened this issue Dec 4, 2013 · 5 comments

Comments

@calvinmetcalf
Copy link

it would be nice to have an easy way to tell rbush that it can find the bbox array somewhere besides the root, i.e. if you have an object that has it's bbox in item.bbox, maybe pass a 'string' to format instead of an array and have _initFormat do this for strings, can do a pull.

@mourner
Copy link
Owner

mourner commented Dec 4, 2013

The current format handling allows you do it like this (perhaps it's not obvious and I should add a note to the readme):

rbush(9, ['.bbox.minLng', '.bbox.minLat', '.bbox.maxLng', '.bbox.maxLat']);

For even more complex situations, you can redefine methods toBBox, compareMinX, compareMinY as per #14.

@calvinmetcalf
Copy link
Author

yeah I guess I meant way to do it easier then rbush(9,['.bbox[0]','.bbox[1]','.bbox[2]','.bbox[3]'])

@mourner
Copy link
Owner

mourner commented Dec 4, 2013

@calvinmetcalf I thought that was easy enough... How would a perfect API look in your opinion?

calvinmetcalf added a commit to calvinmetcalf/rbush that referenced this issue Dec 4, 2013
@calvinmetcalf
Copy link
Author

a bit like #23

@mourner
Copy link
Owner

mourner commented Jun 29, 2016

With the recent API change in 2.0, where bbox is no longer an array by default, I think we should keep format options as is.

@mourner mourner closed this as completed Jun 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants