BartVandewoestyne / oaconvert

OpenAir to Polish Format, GPX and KML convertor.
GNU General Public License v3.0
13 stars 7 forks source link

Newline in Polish Label #131

Open SchwarzwaldFalke opened 9 years ago

SchwarzwaldFalke commented 9 years ago

I had a problem with new lines added to the polish label if an altitude is written into the label. e.g. Label= 5943m FL (CTA S )

I "solved" it for me, with the boost library:

include <boost/algorithm/string.hpp>

And inside getPolishLabel() changed

    if ( needsAltitudeInLabel(airspace) ) {
        string myName(airspace.getName());

to

    if ( needsAltitudeInLabel(airspace) ) {
        string myName(airspace.getName());
        boost::algorithm::trim(myName);

There is for sure a better solution, but my C++ skills are really poor. :-)

BartVandewoestyne commented 9 years ago

I tried to reproduce your problem using the OpenAir files in the openair directory, but I didn't find a file that leads to the same behaviour as you describe. Could you provide us the OpenAir file that is causing this behaviour? Maybe put it online and share the link with us? That would allow me to try to reproduce your problem.

SchwarzwaldFalke commented 9 years ago

Sure. The open air file: https://gist.github.com/SchwarzwaldFalke/615e46ab9fa94834b96f

The resulting polish file (used extract_maps.sh in utils directory): https://gist.github.com/anonymous/42caac0b57dc5c320287

Hope this helps.

BartVandewoestyne commented 9 years ago

This is where it gets interesting... I just converted your Open Air file on my laptop and I don't have the newlines in the Polish label. So it seems like there is something non-portable going on here. Could you please let me know on what platform you are building and running oaconvert? And just to double-check that we are not dealing with typical CR/LF problems (see [1]): the md5sum for the Open Air file that you specified is

mc303@maverick:/tmp/oaconvert/src$ md5sum ~/austria.txt 
cbfc29bd1001daa963b7de9ee68881ef  /home/mc303/austria.txt

I am building and running on the following platform:

mc303@maverick:~$ uname -a
Linux maverick 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:14:51 UTC 2015 i686 i686 i686 GNU/Linux
mc303@maverick:~$ cat /etc/issue.net 
Ubuntu 14.04.2 LTS

[1] http://en.wikipedia.org/wiki/Newline#Common_problems