The German AIP (Wikipedia) has lots of coordinates in the form of
B10 N 50 02 55.23 E 008 34 17.78
B20 N 50 02 52.90 E 008 34 19.84
B22 N 50 02 50.46 E 008 34 18.10
B23 N 50 02 49.70 E 008 34 20.35
B24 N 50 02 48.70 E 008 34 16.77
B25 N 50 02 47.48 E 008 34 15.73
V115 N 50 02 56.00 E 008 35 19.62
V116 N 50 02 55.48 E 008 35 19.92
V326 N 50 01 42.83 E 008 34 05.72
V328 N 50 01 45.41 E 008 34 04.24
A more easily readable form for the first entry would be
B10 N50Β°02'55.23" E008Β°34'17.78"
where B10 is the label text. Currently I extract that with some regex and a bit of math to get it into a GMT-friendly version:
8.571606 50.048675 B10
Is there an elegant way to read the original input with GMT directly? My convert-fu seems to be lacking as my experimentation led nowhere so far.
@Andreas, that rule is true. The regex does work, easy to read β¦ not so much. I try to keep the scripts portable, thatβs why I try to strive for simple bash solutions. Currently Iβm experimenting with
line=$'B10 N 50 02 55.23 E 008 34 17.78'
unset IFS
read -ra arr -d '' <<<"$line"
i=0; for a in "${arr[@]}"; do let i++; echo "$i [$a]"; done
Hi @Joaquim thatβs true β the Wikipedia link was meant to explain AIP. If you want the tables have a look at this page for example. If you are interested in the full thing try https://aip.dfs.de/basicIFR/ and have a look around.
Clicking through AD > AD 2 > Frankfurt Main > AD 2 EDDF 1-5 would lead you to one of those pages.
Python has many tools and functions for reading and parsing text files. Then you can do the math and plot with PyGMT without having to combine regex and bash scripts. Of course, some people would recommend Julia ;-).
Gentlemen, my apologies. I didnβt point out to you that the pdf-version of the page hides behind the little printer icon in the upper right corner. Not sure if direct linking to it works.
Running it through my parser setup gives me the following text file: AD 2 EDDF 1-5.txt (17.6 KB)
There is - even a nice XML version in AIXM 5.1 format - but unfortunately those things come with a price tag. We are talking in the range of tens of thousands of Euros. Just a little bit outside my budget.
So what Iβm doing right now is getting the pdf files, parse them and then precondition them for GMT usage. That preconditioning step is not as flexible as I hoped with my regex solution. Thatβs why Iβm looking for alternatives.
Sometimes it is hard to see the wood for the trees and an outside input helps wonders. In the end the combination of read and gmt math turned out to be the most robust solution for my level of expertise.