Select all points in a matrix within 30m of another point

Posted by pinnacler on Stack Overflow See other posts from Stack Overflow or by pinnacler
Published on 2010-05-11T22:24:07Z Indexed on 2010/05/11 23:44 UTC
Read the original article Hit count: 270

Filed under:
|
|
|
|

So if you look at my other posts, it's no surprise I'm building a robot that can collect data in a forest, and stick it on a map. We have algorithms that can detect tree centers and trunk diameters and can stick them on a cartesian XY plane.

We're planning to use certain 'key' trees as natural landmarks for localizing the robot, using triangulation and trilateration among other methods, but programming this and keeping data straight and efficient is getting difficult using just Matlab.

Is there a technique for sub-setting an array or matrix of points? Say I have 1000 trees stored over 1km (1000m), is there a way to say, select only points within 30m radius of my current location and work only with those?

I would just use a GIS, but I'm doing this in Matlab and I'm unaware of any GIS plugins for Matlab.

I forgot to mention, this code is going online, meaning it's going on a robot for real-time execution. I don't know if, as the map grows to several miles, using a different data structure will help or if calculating every distance to a random point is what a spatial database is going to do anyway.

I'm thinking of mirroring two arrays, one sorted by X and the other by Y. Then bubble sorting to determine the 30m range in that. I do the same for both arrays, X and Y, and then have a third cross link table that will select the individual values. But I don't know, what that's called, how to program that and I'm sure someone already has so I don't want to reinvent the wheel.

Cartesian Plane
GIS

© Stack Overflow or respective owner

Related posts about matlab

Related posts about matrix