Coords type returned by position sensor component

109 views
Skip to first unread message

bianca fenice

unread,
Nov 4, 2017, 3:28:39 PM11/4/17
to MIT App Inventor Forum
What are the type of coords returned by GPS position sensor component?

I know that it is possible to represent coords in different methods and I suppose that the AI position sensor component uses the Centesimal System ( or French System). Am I right? Can some one add the spec to the general help of the component at http://ai2.appinventor.mit.edu/reference/components/sensors.html#LocationSensor.

I also suppose that it is possible converting the coords returned by the component into a different system, but the component don't have this feature in it.

It is possible to add to the component in future AI improvements such a feature?

In the meanwhile I'm using the following algorithm to make the conversion:

Examples:

151,28412° =
151° (0,28412⋅60)' = 
151° (17,0508)'  = 
151° 17' (0,0508⋅60)' '=

151° 17' 3'' , 048



Viceversa:
30° 43' 12" =30° + 43/60 + 12/3600 = 30,72


I am not an expert so while AI position sensor component doesn't have any built in automatic conversion function I need to ask: am I doing the right way?


Thanks

SteveJG

unread,
Nov 4, 2017, 3:54:31 PM11/4/17
to MIT App Inventor Forum
You can use the online converter to check your conversions from decimal degrees to degrees, minutes, seconds   http://www.rapidtables.com/convert/number/degrees-to-degrees-minutes-seconds.htm 
There is also an algorithm to make the conversion.

The LocationSensor uses decimal degrees  to be compatible with the output of the output of the satellites of the Global Positional Satellites.
Latitudes North of the equator are positive; latitudes South of the equator are negative.  Longitudes up to 180 deg West of the Prime Meridian are negative values; those up to 180 degrees East are positive values.

You can read more about the system in use here:  Exploring with Location Sensor in AI2

The location sensor object is used to communicate with the global positioning satellite receiver (GPS) in your phone/tablet. When the LocationSensor communicates with the built-in GPS receiver, the GPS can determine the location of your device.  The sensor can also work with network/wifi location services.  Finding a location using the network uses very different techniques to determine a location. Location means, the device's present latitude and longitude or it can mean your street address.


It contains a more detailed explanation than the documentation for the LocationSensor (  http://ai2.appinventor.mit.edu/reference/components/sensors.html#LocationSensor )

It is possible to convert the decimal degrees to various coordinate systems like UTM  or as you did, degrees, minutes, seconds  using algorithms or a procedure using blocks.  These conversions could also be done using an extension if you know how to program in Java.  Here is a Forum thread about UTM coordinates  https://groups.google.com/forum/#!msg/mitappinventortest/K-bbAZmFbSo/RPudd1gmBgAJ;context-place=categories/mitappinventortest 

Old time cartographers used degrees, minutes and seconds on maps;  modern computer systems and the satellite navigation systems use decimal degrees and it is the most widely used and accepted way of describing geocoordinates today.

151° 17' 3"
= 151° + 17'/60 + 3"/3600
= 151.2842°

d = int(30.72°) = 30°
m = int((30.72° - 30°) × 60) = 43'
s = (30.72° - 30° - 43'/60) × 3600 = 12"
30.72°
= 30° 43' 12"

The GPS satellites provide coordinate data to a precision of five decimal places  (30.12345   so additional decimals are meaningless

Regards,
Steve




bianca fenice

unread,
Nov 4, 2017, 4:20:43 PM11/4/17
to mitappinv...@googlegroups.com
Great! Just what I was looking for!
Thanks
I hope in the future releases of AI the conversion algorithm will be integrated by default making possible to choose what type of coordinates have to be shown just with an option into the component

Anyway the following is the routine that I'm going to use for the conversion:




Further optimizations are of course appreciated.
Thanks.
Reply all
Reply to author
Forward
0 new messages