Closed hoogw closed 4 years ago
Is there function I can get by id?
How to return item by id?
For example I insert 2 item, with id field 1, 2 `const item = { minX: 20, minY: 40, maxX: 30, maxY: 50, id: 1 }; const item2= { minX: 10, minY: 20, maxX: 20, maxY: 30, id: 2 }; tree.insert(item); tree.insert(item2);`
Now, I want get the item by id only.
`const result = tree.getByID(2);`
Then I get item return as item2, because its id is 2.
There isn’t, because that’s not what an RTree does. Perhaps this isn’t the right sort of data structure you’re looking for?
Duplicate of #104.
Is there function I can get by id?
How to return item by id?
Now, I want get the item by id only.
Then I get item return as item2, because its id is 2.