2D line segment handling with data structures

Discuss all kind of algorithms and data structures from their mathematical and programming sides.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

2D line segment handling with data structures

Postby g_niro » Thu Feb 28, 2013 5:10 am

I have huge list of 2d line segments. I want to find nearest line segments for a given segments and then to store in a vector. So, I want to do this for each and every line segment so that I know nearest line segments for any line segments at the end (This is what i want to know). All my line segments are in vector form that is, I know both end point coordinates. So in my data line-number, begin (x,y,z), end(x,y,z) are there.

For obtaining the line segments, I want to check the distance between the line segment and end point of another line segment and can be done via this as mentioned here (http://stackoverflow.com/questions/849211/shortest-distance-between-a-point-and-a-line-segment).

I think there might be some data structures that all these things happen and give a vector of vector line segment numbers or some other way to recognize proximity line segments. I know kd-tree (k-nearest) can do the similar thing. But it is for point data.

I was trying to figure out this with opencv r-tree function. But as I do not have any experience of using r-tree I was not able and I am confused now because it says about a classifier and a training phase. But for my case, I feel I don’t want such things to follow.

If anyone knows any function or codes or library to do this type of thing, please let me know.
Posts: 1
Joined: Thu Feb 28, 2013 5:07 am

Return to Algorithms & Data Structures

Who is online

Users browsing this forum: No registered users and 1 guest