-
Notifications
You must be signed in to change notification settings - Fork 84
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
Remove the need of POIs initialization #80
Comments
Yeah but there's an assertion that it can only be called once. Seems like some deeper surgery will be necessary. |
Difficult to know why it doesn't just returns in case it's already initialized. |
Well you have to tell it how many POI categories you're going to have, so this is the call that does that. Then the first call that you initialize will only initialize one category, and each successive call will initialize a category. It seems to make sense. It'd be nice to be able to change the number of categories after the first step, but that doesn't seem support by CH. As for the assertion, don't those only exist when compiled in debug mode? |
Looks like that we need to solve this in order to solve #73. When I look at the code, I wonder why we can't just reinitialize an element of poiIndexArray, or even make it longer or shorter. Is it more complicated than that? It very well might be - I didn't look too much deeper than that. Remember Dennis just did this work in a few days so maybe he just didn't want to add the methods and do the error checking to modify the array... |
Right. What you say seems to be right. As always, with C++ it's often difficult to understand all the container / memory handling until you get to the last line of the code and check that there are no strange allocations, but it doesn't seem to be the case. In principle, two comments:
|
Fixed by #87 |
Currently, it is necessary to call an initialization routine when adding POIs to a network:
net.init_pois(num_categories=1, max_dist=2000, max_pois=10)
As documented in the tutorial here
I tracked down the need for this initialization down to the CH code, and it seems that the need comes from the initialization of these data structures.
Then, it seems to be that a way to do that initialization on demand should exist.
It would be great to know @fscottfoti opinion about this.
The text was updated successfully, but these errors were encountered: