in reply to Re: AoA data merging
in thread AoA data merging

In other words, you started with an array of chunks, with each chunk containing an array of points -- try making a different structure the other way around: an array of points, and each one cites one or more road-chunks that it is a part of. This would be easiest if the point array is actually a hash, keyed by the X,Y coordinates.

Although this is a good idea, the problem with this approach is that order matters, if the points of the arrayrefs get rearranged it can change the results. This does suggest an alternate approach that I will have to play with though, if I were to put just the ends of each chunk into a simpler data structure, I could order them using only two points per chunk, then it would be pretty easy to identify which chunks those end-points are associated with, it's likely that would eliminate some of the problems I've been having with my earlier approach.

Update: In a node I hadn't read yet, someone else had already thought of this approach, and posted code. I love perlmonks! Thanks for all the help guys, I have several things to try out now based on all your suggestions.