OT: GPS Problem Solutions with Original format to Digital:

classic Classic list List threaded Threaded
1 message Options
Michael D. Setzer II Michael D. Setzer II
Reply | Threaded
Open this post in threaded view

OT: GPS Problem Solutions with Original format to Digital:

=The solution to modify the data to time format with special edit option
was really nice, but not sure how much work would be required to
modify it. Tried to do it directly in other ways, but couldn't do it, and
from feedback it seems it is no longer possible since libreoffice doesn't
support the formula..
Created test file with 1000 GPS addresses with randon values with
libreoffice to a text file. Original setup has each on separte line.
sed process does the 1000 items in 0.048 seconds.Then converted same data to 500 lines with 2 sets of GPS addresses per
line. Then wrote singlec++ program to process 500 lines of data.
Time: 0.005s.

So, guess there are different methods to solve the problem.
If anyone interested, can send the simple c++ program. Only little issue,
was the the degree code that was in orginal posted data was a two byte
version. Had to add a line of code to handle either single or double byte
coding of that. In the sed solution, I had pasted the symbol, so didn't see
issue, but in the c++ put the hex value. If anyone wants code, just send
me an email..

Not really of any interest to me, since I don't have anything that deals
with GPS or Digital address data. But don't like not being able to solve
interesting problems. Thanks for the time, and hope this thread wasn't to
much trouble to some..

Be Safe and Have a Great Day...

Sed Process that produces output of 1000 data points to 500 sets.
time ./gpssed.sh

input first 8 lines (makes 4 pairs)
First 4 sets from gpsbc.csv GPS 1, Data 1, GPS 2, Data 28377'73N,84.30361111111111111110,419'9=E,41.15250000000000000000

sed -e 's/^/=(/;s/\/+/;s/\x27/\/60+/;s/\x22/\/3600/;s/O\|S/\)*(-1)/;s/N\|E/)/'gps.txtgps.csv
sed -e 's/^/(/;s/\/+/;s/\x27/\/60+/;s/\x22/\/3600/;s/O\|S/\)*(-1)/;s/N\|E/)/'gps.txtgps.raw
paste -d, gps.txt gps.csvgpsboth.csv</div>bc -lgps.rawgps2.txt
paste -d, gps.txt gps2.txt |awk '{line=line,t;$0} NR%2==0{print line;line=}'| sed -e 's/^,//g'gpsbc.csv
if [ -n$1] ; then libreoffice --infilter=CSV:44,34,76,1 gps.csv gpsboth.csv gpsbc.csv ; fi

// Then decided to try to do it with a simple C++ program.
// Amost 10 times faster with 500 pairs of address to original format of data.
/* gpsc3.sh
if [ -n$1] ; then libreoffice --infilter=CSV:44,34,76,1 gpsc3.csv; fi

Time less libreoffice line.
time ./gpsc3

Input file lines with pairs of address (first 4 lines)</span>
8377'73N 419'9E1562'44S 3442'82O</div>6683'98N 579'22E6130'46S 2028'78O</div>Output file
8377'73N 419'9E; ,84.30361176,41.15250015
1562'44S 3442'82O, -16.04555511, -34.72277832
6683'98N 579'22E,&#
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy