You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The entries/nodes I store in RBush have many properties, including an 'id' field.
When performing a search-query, I only need a list of ids, rather than a list of entries.
To do so, I currently use the map function:
var entries = tree.search(bbox);
var ids = entries.map(function(val) {
return val.id;
});
For my specific case, it would be nice if RBush could offer this functionality for me, so that I don't need to convert the result myself anymore. (Note: changing the result.push(child); into an result.push(child.id); in rbush's search method does the trick.)
To do this, the search-function could take a second, optional parameter where I can pass the string ".id". This would work similar to the constructor method that accepts a format (and which is awesome!).
However, I'm not sure if there is enough demand for this feature and if it makes sense to put it into RBush.
The text was updated successfully, but these errors were encountered:
maja42
changed the title
Feature request: searchMap()
Feature request: search(bbox, dataString)
Jun 2, 2017
Thanks for the suggestion! However, I don't think it's worth complicating the API with additional options if you can simply call entries.map(p => p.id), which is simple and straightforward.
The entries/nodes I store in RBush have many properties, including an 'id' field.
When performing a search-query, I only need a list of ids, rather than a list of entries.
To do so, I currently use the map function:
For my specific case, it would be nice if RBush could offer this functionality for me, so that I don't need to convert the result myself anymore. (Note: changing the
result.push(child);
into anresult.push(child.id);
in rbush's search method does the trick.)To do this, the search-function could take a second, optional parameter where I can pass the string
".id"
. This would work similar to the constructor method that accepts a format (and which is awesome!).However, I'm not sure if there is enough demand for this feature and if it makes sense to put it into RBush.
The text was updated successfully, but these errors were encountered: