Mobile Apps - GPS and finding

Asked By James hotmail
12-Nov-09 08:33 AM
Hello All,

I am playing with a GPS application. I have a database of gps positions and
would like to know how you go about matching these records with the current
position. An exact match is not good enough. Also, having the ability to
show/update the user on status - your 5 blocks away, 4,3,2 and 1 block away.
Lastly, provide some guidance, like "Head North", "Head East" etc.

Is there a good book or website that discussing this type of math?


-James
Database
(1)
Louisiana
(1)
Lakewood
(1)
Avenue
(1)
Lon
(1)
Lat
(1)
Approximates
(1)
Longitude
(1)
  DickGrier replied to James hotmail
13-Nov-09 12:02 AM
Hi,

I simply truncate the current Lat/Lon values, as read from my GPS device to
some number of digits past the decimal places and use the SQL Like statement
to return a dataset that corresponds with them.

Here is some simple math that approximates distance.  Since "blocks" are not
of fixed-size (some are 10 to the mile, but there is not a pure standard),
I am not sure how useful trying to state something in blocks might be.

Approximate distance in miles:

sqrt(x * x + y * y)

where x = 69.1 * (lat2 - lat1)
and y = 53.0 * (lon2 - lon1)

You can improve the accuracy of this approximate distance calculation by
adding the cosine math function:

Improved approximate distance in miles:

sqrt(x * x + y * y)

where x = 69.1 * (lat2 - lat1)
and y = 69.1 * (lon2 - lon1) * cos(lat1/57.3)

Make sure you convert the latitude and longitude values from degrees to
radians. Trigonometric math functions such as sine and cosine normally
require conversion of degrees to radians, as described above.

You can use some very simply comparison of the target Lat and Lon, with the
current Lat and Lon to say, "North, South, East, West."  If the target Lat
is greater than the current, then head north, if less then head south; if
the target Lon is greater than the current, then head west, and if less,
then head east.  Now, the math work is almost done for you.  The legs of the
triangle that you calculate above are the actual distances
north/south/east/west (as needed).

Dick

--
Richard Grier, Consultant, Hard & Software 12962 West Louisiana Avenue
Lakewood, CO 80228 303-986-2179 (voice) Homepage: www.hardandsoftware.net
Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004, Revised July
2006.
  James hotmail replied to DickGrier
12-Nov-09 09:23 PM
Thanks Dick,
That's a good point, not all blocks are the same size. Providing directions
like North, South etc. will be descent... adding an approximate distance
will be helpful, more of a gauge or 'rule of thumb'.

-James
Create New Account
help
Synchronising data between PDA database and system database Mobile Apps Hi All, Im new to developing PDA applications.I have a SQl Mobile edition database running in my PDA and a sql server 2005 database on my Web Server.Periodically i need to synch the contents between my mobile database and server database. Is there any application available for this or I have to write it on my guide me in probing more on this. Regards, Ravi PocketPC Developer Discussions SQL Server (1) Database (1) PDA (1) RaviRe (1) RDA (1) Mobile (1) Server (1) Applications (1) Ravi, You in SQL Mobile (or SQL Compact Edition) Books Online. - - Ginny keywords: Synchronising, data, between, PDA, database, and, system, database description: Hi All, Im new to developing PDA applications.I have a
Compressing(ZIP) the database file Mobile Apps Hi, I want to ZIP or compress the database file. My Database file name is test.sdf Suggest me the ways to do it. Regards, kracks WindowsCE App Development Discussions OpenNETCF (1) Database (1) EMVP (1) Tacke (1) C6efef389b2b (1) E1ae9ab2 (1) Fab5bd5d (1) Zlibce (1) Compress it 5:45 = A0pm, "Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com> mpress I am doing Database back up in wince device. I want to ZIP the database file in my wince device since the DB size goes on increasing as log data 15, 5:45 pm, "Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com> I am doing Database back up in wince device. I want to ZIP the database file in my wince device since the DB size goes on increasing as log data
File Copy in eVC++ Mobile Apps I want to copy the database from one folder to another folder. Further if my destination database name is static i was able to copy the database from one folder to another folder using the following command CopyFile(_T(" \ testdb.sdf"), _T testdb1.sdf"), FALSE); I was able to execute the above command successfully. If the Destination database name is variable(eg. every time if i want to take a back up of case my second parameter is a variable. If so how can i copy the the database from source(testdb.sdf) to destination database. eg. wcscpy(tempDirectory, L" \ Windows \ test_March.sdf"); CopyFile(_T(" \ testdb.sdf"), tempDirectory, FALSE); The above code doesn't work. . . Please suggest me how to copy from source database to destination database which is a variable. Regards, Kracks. WindowsCE App Development Discussions OpenNETCF (1) GetLastError (1) Database
Compressing SQL CE Database file in Wince device Mobile Apps How can i compress a SQL CE Database file in my wince device having wince 5.0? Database file name is sample.sdf. Its SQL CE 2.0 database file. Suggest me. Regards, Vina WindowsCE App Development Discussions Database (1) Vina (1) B0750032 (1) PCMCIA (1) SDIO (1) A548 (1) I don't think, although I'm not a big database guy, that SQL CE 2.0 supports compression of the database. You want the data compressed to save space while you use the database? At the cost of how fast you can add / remove / query data in the table