FORUMS

[APP] Co-Ordinates Application - Final [updated now for droid too]

5,135 posts
Thanks Meter: 1,214
 
By timmymarsh, Senior Moderator - Emeritus on 21st November 2008, 12:08 PM
Post Reply Email Thread
Hi All Site Engineers out there,

I had searched for ages to find an app for windows mobile devices that quite simply calculated either new grid co-ordinates from a know point given its bearing and distance or to calculate a bearing and distance given two known points.

I had written a program for a personal computer using (BASIC) but why carry a phone and a computer with you on a building site!

I couldnt find one that was simple, meaning less mistakes when "in the field", so Gino wrote me one. Feel free to download, use and change. Many thanks to GinoAMalone for this simple app, so please donate to either him or XDA of course

The app has a simple home screen giving you 3 choices:

1. New Co-ords Calculator
2. Distance & Bearing Calulator
3. Pythag Calculator

The app is tested on Touch Cruise 6.0 & 6.1, Prophet 6.1. & Blackstone 6.1 & 6.5, Touch Pro & HD2.

Other devices not tested so please give feed back & Screen shots to come.


UPDATE: December 2010: This App has now been written for Android also, please head over to this for info and give thanks to Captainkrtek & Scary Alien
Attached Thumbnails
Click image for larger version

Name:	Screen01.jpg
Views:	398
Size:	13.3 KB
ID:	167090   Click image for larger version

Name:	Screen02.jpg
Views:	365
Size:	18.7 KB
ID:	167091   Click image for larger version

Name:	Screen03.jpg
Views:	299
Size:	18.6 KB
ID:	167092   Click image for larger version

Name:	Screen04.jpg
Views:	241
Size:	13.4 KB
ID:	167093  
Attached Files
File Type: cab Coordinates-1.0.104.CAB - [Click for QR Code] (23.3 KB, 159 views)
21st November 2008, 09:33 PM |#2  
Senior Member
Flag Cleveland, Ohio
Thanks Meter: 53
 
More
How's this...
Here's a first pass at the app. This sounded like an interesting challenge and something to get me started learning more of WinMo programming. This is my second or third app for .Net. This is written in C# and should only need CF .Net 2.0.

I still need to clean up some rough edges. Right now it doesn't do anything about formatting the output how you requested and most input errors will cause it to crash.

I'm not sure if it's using the same distance algorithms you used. I got my code from http://www.movable-type.co.uk/scripts/latlong.html and http://bryan.reynoldslive.com/post/L...e2c-and-C.aspx. The algorithm I used is called the spherical law of cosines on the first link.

But, let me know if it looks like the sort of thing you need. I'll PM you with my email address.

Thanks,
Gino A...

Update [20 mins later]: I had a boneheaded mistake in the CAB. Fixed now.
Attached Files
File Type: cab Coordinates-0.1.100.CAB - [Click for QR Code] (21.8 KB, 47 views)
File Type: zip Coordinates-0.1.100.zip - [Click for QR Code] (28.7 KB, 31 views)
22nd November 2008, 09:09 AM |#3  
timmymarsh's Avatar
OP Senior Moderator - Emeritus
Flag - Just one More
Thanks Meter: 1,214
 
Donate to Me
More
Quote:
Originally Posted by GinoAMelone

Here's a first pass at the app. This sounded like an interesting challenge and something to get me started learning more of WinMo programming. This is my second or third app for .Net. This is written in C# and should only need CF .Net 2.0.

I still need to clean up some rough edges. Right now it doesn't do anything about formatting the output how you requested and most input errors will cause it to crash.

I'm not sure if it's using the same distance algorithms you used. I got my code from http://www.movable-type.co.uk/scripts/latlong.html and http://bryan.reynoldslive.com/post/L...e2c-and-C.aspx. The algorithm I used is called the spherical law of cosines on the first link.

But, let me know if it looks like the sort of thing you need. I'll PM you with my email address.

Thanks,
Gino A...

Update [20 mins later]: I had a boneheaded mistake in the CAB. Fixed now.

Hey Gino,

THanks for the app. have given it a test and come up with error on coords and vector parts:
"latitude value cannot be greater than 90"

ALso suggestion, can you also have metres and millimetres as units too? sounds daft maybe, but if working out bearings and new co-ords for setting out a building units would be in metres or mm. This woud prob explain the latitude error.

Also when im inputting in the bearing how should it be inputted? like this: 95'32'25' ?? or have you done in decimal.

Ok, after thought. I know the reason why the latitude error occurs, its beacuse the co-ords input is in degrees, minutes, seconds. I would need an option for co-ords based in meters for example, easting=500.735 northing=345.321 This is important when calculating results for buildings setting out. Can you please put an option in for this, or even purely base the program in metres/mm rather then degress. Obviously the bearing would still need to be in degree, minutes & seconds.

Thanks Gino, the app looks great and im sure with minor tweaks you will have it running in no time!
22nd November 2008, 04:32 PM |#4  
Senior Member
Flag Central Kentucky
Thanks Meter: 1,191
 
More
What about a simple GPS related program which allows you to put in waypoints? It'll give you the distance, heading, etc.. Most of them you can also do offsets of X distance and Y heading, etc..

They do not imply having or using the GPS. Generally you turn the GPS on if needed, but you could use the coordinate related stuff without it.
22nd November 2008, 04:42 PM |#5  
timmymarsh's Avatar
OP Senior Moderator - Emeritus
Flag - Just one More
Thanks Meter: 1,214
 
Donate to Me
More
Quote:
Originally Posted by khaytsus

What about a simple GPS related program which allows you to put in waypoints? It'll give you the distance, heading, etc.. Most of them you can also do offsets of X distance and Y heading, etc..

They do not imply having or using the GPS. Generally you turn the GPS on if needed, but you could use the coordinate related stuff without it.

Khaytsus thanks for your thoughts. I dont think the GPS is the way to go with this. Yes it would calculate distance and bearing, but i need to input grid line references (co-ords) like 500 metres east, 200 metres north. the calculations in my basic code are based on a 2d grid line system. the app would not need to to use gps. Sometimes when working out co-ors or bearing and distance for setting out a building, the distance from 2 given points could be 100 metres but anything as little as 3 metres. GPS may not provide 1mm accuracy.

If my code was used in the app, it would work, i know it does as i have used it many times before. dont think about curvature of the earth or lon & lat think more grid lines like a flat map. see next post for example.
22nd November 2008, 05:05 PM |#6  
timmymarsh's Avatar
OP Senior Moderator - Emeritus
Flag - Just one More
Thanks Meter: 1,214
 
Donate to Me
More
BASIC - code
Ok my BASIC code below, also attached is a simple (apols) jpeg of what the app should be doing. You will see a red house situated in a grid line system, with its grid co-ords above the relevant point. Hope this is of some help to Gino and anyone else


Code:
To Calc New Co-ords

10 print "New Co-ords"
20 input "Easting=",A, "Northing=",B
22 input "Bearing=",C, "Distance=",D
30 F=sinC*D+A
40 G=cosC*D+B
50 set F4
60 print "Easting 1=";F; "Northing 1=";G
65 goto 22
70 End


To Calc Distance & Bearing

10 print "Bearing & Distance"
20 input "E0=",P,"N0=",Q
30 input "E1=",A,"N1=",B
40 C=A-P
50 V=ABS(C)
60 D=B-Q
70 W=ABS(D)
80 if C=0 then 210
90 if D=0 then 260
100 if C>0 then 160
110 if D>0 then 140
120 E=(ATN(V/W))+180
130 goto 300
140 E=(ATN(W/V))+270
150 goto 300
160 if D>0 then 190
170 E=(ATN(W/V))+90
180 goto 300
190 E=ATN(V/W)
200 goto 300
210 ifD>0 then 240
220 E=180
230 goto 300
240 E=0
250 goto 300
260 ifC>0 then 290
270 E=270
280 goto 300
290 E=90
300 H=(C~2+D~2)~0.5
310 print "Bearing=";DMS$(E)
320 print "Distance=" H
330 End

please note symbol "~" means to the power of (could not find the proper symbol on my keyboard)
also DMS$ = degrees minutes seconds (the new bearing should be displayed in this format, not in decimal)
ATN = (shift tan on sci calculator)
ABS = (shirt LOG on sci calculator)

Pythag Calculation

10 print"Pythag"
20 input "side A=",A,"side B= ",B
30 C=(A~2+B~2)~0.5
40 print "Hyp= ";C
50 goto 10
60 end
Attached Thumbnails
Click image for larger version

Name:	co-ord example.jpg
Views:	97
Size:	24.6 KB
ID:	131820  
23rd November 2008, 02:05 AM |#7  
Senior Member
Flag Central Kentucky
Thanks Meter: 1,191
 
More
Quote:
Originally Posted by timmymarsh

Khaytsus thanks for your thoughts. I dont think the GPS is the way to go with this. Yes it would calculate distance and bearing, but i need to input grid line references (co-ords) like 500 metres east, 200 metres north. the calculations in my basic code are based on a 2d grid line system. the app would not need to to use gps. Sometimes when working out co-ors or bearing and distance for setting out a building, the distance from 2 given points could be 100 metres but anything as little as 3 metres. GPS may not provide 1mm accuracy.

If my code was used in the app, it would work, i know it does as i have used it many times before. dont think about curvature of the earth or lon & lat think more grid lines like a flat map. see next post for example.

Aha, okay. I was thinking larger scale, less precision, etc. I have to 'deal' with northings and eastings every time I look up benchmark documentation and I always have to figure out how to convert it.. Grid, datum, etc..
5th December 2008, 05:29 PM |#8  
timmymarsh's Avatar
OP Senior Moderator - Emeritus
Flag - Just one More
Thanks Meter: 1,214
 
Donate to Me
More
Hi Guys,

Any updates? Please dont think im impatient, im certainly not, just willing to help in anyway i can

Regards.
5th December 2008, 06:01 PM |#9  
Senior Member
Flag Cleveland, Ohio
Thanks Meter: 53
 
More
Quote:
Originally Posted by timmymarsh

Hi Guys,

Any updates? Please dont think im impatient, im certainly not, just willing to help in anyway i can

Regards.

I didn't get as much time last weekend to make progress as I hoped. I did do some cleanup of the UI and add several more units. I believe there are no more circumstances where poorly formatted input causes crashes. I also eliminated the "calculate" button and have it calculate whenever enough info is available. The biggest motivator for this was so the UI works fine with a SIP open.

I still need to look at formatting the output and spend some time with your algorithm.

Thanks for the challenge. this is working as an excellent vehicle for me to learn about .Net CF programming.
Attached Files
File Type: cab Coordinates-0.1.101.CAB - [Click for QR Code] (21.3 KB, 26 views)
5th December 2008, 07:23 PM |#10  
Member
Thanks Meter: 0
 
More
try G7toCE

http://www.gpsinformation.org/ronh/

this javascript page will run offline in PIE

http://williams.best.vwh.net/gccalc.htm
8th December 2008, 07:42 PM |#11  
timmymarsh's Avatar
OP Senior Moderator - Emeritus
Flag - Just one More
Thanks Meter: 1,214
 
Donate to Me
More
Quote:
Originally Posted by GinoAMelone

I didn't get as much time last weekend to make progress as I hoped. I did do some cleanup of the UI and add several more units. I believe there are no more circumstances where poorly formatted input causes crashes. I also eliminated the "calculate" button and have it calculate whenever enough info is available. The biggest motivator for this was so the UI works fine with a SIP open.

I still need to look at formatting the output and spend some time with your algorithm.

Thanks for the challenge. this is working as an excellent vehicle for me to learn about .Net CF programming.

Gino,

Thanks for the heads up, the app is comin on great. Did you understand my rarther poor explanation of what i meant about inputting the grid line co-ords and did my crude diagram help? I am very thankful and glad i am able to help stimulate you grey cells Get back if i can be of any help please.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes