Sorry for the super weird title, but it's the best I can describe the problem.
The actual problem is that I have a large amount of data received from GPS trackers on several vehicles. It describes the position of the vehicle at a given time in terms of it Latitude and Longitude. One reading every 15 seconds.
I have to filter this data to only count points within a certain area. The problem here is that the area is not parallel to the axes.
Example: I have a lot of lines (straight, curved, bendy, the whole lot) travelling from bottom left to top right, in a messy, unorganized manner. Lets say from the Origin to a range of destinations in the top right corner.
I also have a square who's 4 corners are A (1,5), B (5,7), C (3,1), and D(7,3)
I need to find the points that cross through this region only.
Therefore, I can't solve it by trying to find all co-ordinates with 1<X<7 and 1<Y<7, as that would catch points that don't fit in my range (such as (1,4) or (7,5)). I need a more complex solution.
The best idea I have so far to solve this is either:
1) Define 4 lines (AC, AB, CB and BD) and use nested if conditions to find points that fit within all 4 lines, or
2) Define some sort of 'hitbox' range/matrix, and carry out checks on each value to see if they fall within it.
The reason I am here is because I do not know if VBA for Excel 2010 has the functionality to carry out either of those methods; and if it does, I have no idea how to go about writing the code.
Google, MS Office support site, and a search site all weren't of much help...mainly because I have no idea what search terms to use lol. The 'hitbox' idea came from a programmer friend of mine, and while it's feasible in Java, I couldn't find any way to implement it into VBA.
Also, I don't know if option 2) is actually feasible. The GPS Coordinates that go up to 5 decimal places and have thousands of values within the range I'm working with. I fear it might be too hard to write and/or be too resource intensive.
So yea...any support or guidance would be appreciated! I think Option 1) is the way to go, but if you have any other ideas then do please let me know. I'm open to suggestions!
I'd have attached an image with this post, but I can't use image hosting sites on work internet, so will do so at home.
Thank you so much for the help!
The actual problem is that I have a large amount of data received from GPS trackers on several vehicles. It describes the position of the vehicle at a given time in terms of it Latitude and Longitude. One reading every 15 seconds.
I have to filter this data to only count points within a certain area. The problem here is that the area is not parallel to the axes.
Example: I have a lot of lines (straight, curved, bendy, the whole lot) travelling from bottom left to top right, in a messy, unorganized manner. Lets say from the Origin to a range of destinations in the top right corner.
I also have a square who's 4 corners are A (1,5), B (5,7), C (3,1), and D(7,3)
I need to find the points that cross through this region only.
Therefore, I can't solve it by trying to find all co-ordinates with 1<X<7 and 1<Y<7, as that would catch points that don't fit in my range (such as (1,4) or (7,5)). I need a more complex solution.
The best idea I have so far to solve this is either:
1) Define 4 lines (AC, AB, CB and BD) and use nested if conditions to find points that fit within all 4 lines, or
2) Define some sort of 'hitbox' range/matrix, and carry out checks on each value to see if they fall within it.
The reason I am here is because I do not know if VBA for Excel 2010 has the functionality to carry out either of those methods; and if it does, I have no idea how to go about writing the code.
Google, MS Office support site, and a search site all weren't of much help...mainly because I have no idea what search terms to use lol. The 'hitbox' idea came from a programmer friend of mine, and while it's feasible in Java, I couldn't find any way to implement it into VBA.
Also, I don't know if option 2) is actually feasible. The GPS Coordinates that go up to 5 decimal places and have thousands of values within the range I'm working with. I fear it might be too hard to write and/or be too resource intensive.
So yea...any support or guidance would be appreciated! I think Option 1) is the way to go, but if you have any other ideas then do please let me know. I'm open to suggestions!
I'd have attached an image with this post, but I can't use image hosting sites on work internet, so will do so at home.
Thank you so much for the help!