-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XCSoar (.CUP) and Winpilot (.DAT) file processing now works #90
base: master
Are you sure you want to change the base?
Conversation
wpnum = 0 | ||
for byteline in lines: | ||
wpnum = wpnum + 1 | ||
line = byteline.decode('ISO-8859-2') #gfp 241210: added 'ISO-8859-2' decoding for correct cherrypy logging display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be UTF-8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried 'UTF-8' and AFAICT, it doesn't handle the accent marks in the Slovenia3 waypoint list. I added the 'Slovenia3.cup' and 'Slovenia3.dat' test files for your consideration (the .DAT file was generated from the .CUP file using a separate Python script to make sure they both contained the exact same coordinates)
I have no problem using UTF-8 vs ISO-8859-2, but some of the characters in Slovenia3.cup won't be displayed properly. I don't think this will affect the bounds calculation either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files you provide contain corrupted data.
Slovenia3.cup: Lines 26, 94, 774, 776.
A CUP file should be utf-8. https://github.com/naviter/seeyou_file_formats/blob/main/CUP_file_format.md
These files should only be included if they serve an automated test case, and then they should be under test/data/cup/filename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://download.xcsoar.org/content/waypoint/country/SI-WPT-National-OpenAIP.cup if you need an example that works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.condorsoaring.com/forums/viewtopic.php?f=29&t=22737&p=191905#p191905 seems to be the file from slovenia3 in condor.
# cherrypy.log('in for loop: wpnum = %s line = %s' %(wpnum, line)) | ||
# cherrypy.log(f'for loop row {wpnum}: {line}') | ||
|
||
#check for blank lines or comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of debugging code. We don't really want that in the code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on figuring out the basic problem. :)
Can you please make a change that is as minimal as possible to fix the cup parsing issue and make a commit for it? No Test files or commented out debug code please, also no excessive logging which isn´t needed for operation.
XCSoar (.CUP) and Winpilot (.DAT) file processing now works properly. Unfortunately I couldn't figure out how to get the left/right/top/bottom bounds values to show up in the corresponding web page windows, so the map still isn't generated automatically.
As a workaround the calculated bounds are displayed in the 'error' window, and the user can manually transcribe the values to the bounds entry fields and then select the 'select map bounds by hand' option.