Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i'm starting to create a application map on android
so, it's use only on highway.
i don't know location(Longitude and latitude) which get by GPS on tablet with os android is on highway or normal street.
i have a solution, at highway gateway. i have use a flag to know is highway. But, the area is too small which to check the car at here with the deviations of GPS on smartphone or tablet of OS Android and speed's car(ex: area -30m, speed - 40km/h [so fast to check])
Please help me, what the solution can know the car on highway
Posted

1 solution

Highways are line segments with widths, or in other words, rectangles. If you know the position and size of the rectangle you can determine where the car is.

You would need the geometry of the highway (which should be something like a number of points that form the line segments), you assign a width to them and do simple detection of a point inside that rectangle.

This is a pretty easy concept, but the hard part is that the rectangles are not cartesian aligned, but the world of game programming has a lot of algorithms for determining if a point is inside a rectangle (collision detection).
 
Share this answer
 
v2
Comments
dev C plus 30-Oct-13 22:56pm    
Thanks to your idea
i have think about your idea
so, if i apply, database is so large which not best for the algorithms to find location on highway. i have tried develop with the a few rectangle at highway gateway, but deviations is large on tablet

i have get many rectangle for a highway, which is not best for database on tablet or smartphone
Ron Beyer 30-Oct-13 22:58pm    
You don't get the geometry of the entire highway, just an area surrounding the vehicle. This narrows down your search significantly, and should be a pretty easy query in your database. BTW, there is a reason that most navigation systems (Android and iOS) are web based and use high powered servers to process the data...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900