Page 1 of 1

GPS split in latitude and longitude

Posted: 24 Nov 2013 20:47
by Multimania
Hello,

it is posible to split the variable location in latitude and logitude?

I need it in two variables.

Thanks.

Re: GPS split in latitude and longitude

Posted: 24 Nov 2013 21:55
by Martin!
Maybe you could use the split function?
List split(String s, String pattern)
Splits the string s into a list of strings by using the regular expression pattern as the delimiter.

Re: GPS split in latitude and longitude

Posted: 25 Nov 2013 07:02
by pat2net
I made a script for you to do it. Maybe there is an easiest way but it work.

http://automagic4android.com/flow.php?i ... 859f6b5854

Re: GPS split in latitude and longitude

Posted: 25 Nov 2013 09:51
by Multimania
pat2net wrote:I made a script for you to do it. Maybe there is an easiest way but it work.

http://automagic4android.com/flow.php?i ... 859f6b5854
Thanks, but it does not work.

Re: GPS split in latitude and longitude

Posted: 25 Nov 2013 10:09
by Multimania
Multimania wrote:
pat2net wrote:I made a script for you to do it. Maybe there is an easiest way but it work.

http://automagic4android.com/flow.php?i ... 859f6b5854
Thanks, but it does not work.
getElement({lat}),1); and getElement({lon}),1); does not work.

Re: GPS split in latitude and longitude

Posted: 25 Nov 2013 11:36
by Martin!
The script seems to contain some errors. Try this instead:
http://automagic4android.com/flow.php?i ... 862e287485

I'm using the following script to get latitude and longitude from the location variable:

Code: Select all

loc = split("{location,locationformat,decimal}", ",");
latitude = getElement({loc}, 0);
longitude = getElement({loc}, 1);

Re: GPS split in latitude and longitude

Posted: 25 Nov 2013 12:07
by pat2net
I try it again and it work for me but I'm using the evaluation version of Automagic. Anyway I think the solution by Martin! is more simple then mine and it seem to work for everybody!

Re: GPS split in latitude and longitude

Posted: 26 Nov 2013 07:15
by Multimania
Martin! wrote:The script seems to contain some errors. Try this instead:
http://automagic4android.com/flow.php?i ... 862e287485

I'm using the following script to get latitude and longitude from the location variable:

Code: Select all

loc = split("{location,locationformat,decimal}", ",");
latitude = getElement({loc}, 0);
longitude = getElement({loc}, 1);
Hi,

thanks. i have found the same way!

It works fine and fast ;-)