Notifications
Clear all

10/18/2023 Map Stopped Working?
Visit this post for the fix

Using European Airports

13 Posts
4 Users
0 Reactions
1,038 Views
(@julien220)
Eminent Member
Joined: 4 years ago
Posts: 21
Topic starter  

Hi guys,

I'm trying to build a map of Switzerland and/or Europe. Whenever I try to enter an airport in Europe (EGLL, LFPG, LSZH), I get an error and I am unable to save the airport configuration. I just enter the ICAO identifier just like an US/Canada airport, but it doesn't work. It appears that the FAA website which provides airport information does not have European airports in its database, might that be a problem?

Here is a copy of what is displayed when I try to save the airport file or click enter after editing an airport:


Traceback (most recent call last): File "/usr/lib/python3/dist-packages/flask/app.py", line 2309, in __call__ return self.wsgi_app(environ, start_response) File "/usr/lib/python3/dist-packages/flask/app.py", line 2295, in wsgi_app response = self.handle_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1741, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/NeoSectional/webapp.py", line 543, in handle_appost_request get_apinfo() #decode airports to get city and state to display File "/NeoSectional/webapp.py", line 1263, in get_apinfo state = apinfo.find('state').text AttributeError: 'NoneType' object has no attribute 'text'

Thanks for any tips and tricks!

Julien

PS: Absolutely amazed by the work everybody did for these projects!


   
Quote
 Bill
(@liveadmin)
Member Admin Registered
Joined: 5 years ago
Posts: 0
 

Hi Julien,

 

The European stations are not a problem. We have had users in Ireland and Switzerland make maps with great success.  You can check a station by using the following url.

 

https://aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=1.5&stationString=EGLL

 

Just replace the airport identifier at the end with the one you want to check.  If it returns information then it will work with our platform

 

I'll bet @markyharris will have better insight as to what might be causing the error you are seeing.

 

Thanks,

Bill


   
ReplyQuote
Mark Harris
(@markyharris)
Member Admin Registered
Joined: 5 years ago
Posts: 559
 

Julien, Awesome catch!

I was thinking nationally and not globally when I wrote the routine that went to the FAA to get an airport's details to display. It's an easy fix which I'll detail below, but this will be updated on the GitHub Page soon, but the image that can be downloaded from www.livesectional.com won't be updated until the next major update. So if anyone is reading this and lives outside of the United States, you'll have to apply the same fix until the image is updated or download the webapp.py file from the GitHub page. Once downloaded, copy it to the /NeoSectional directory and overwrite the older version.

The fix will display the 'site' information and 'country' on the Airport Editor when an airport is not located in the United States is entered. - Mark

Fix:

From the command line type (the green text only);

pi@LiveSectionalV4:~ $sudo nano -c /NeoSectional/webapp.py

 

Scroll down to around line 1260 and find the following lines;

root = ET.fromstring(content) #Process XML data returned from FAA

for apinfo in root.iter('Station'):
    stationId = apinfo.find('station_id').text

    site = apinfo.find('site').text
    state = apinfo.find('state').text
    apinfo_dict[stationId] = [site,state]

 

And substitute the following lines for the 3 lines that are in Red Bold font above;

if stationId[0] != 'K':
    site = apinfo.find('site').text
    country = apinfo.find('country').text
    apinfo_dict[stationId] = [site,country]

else:
    site = apinfo.find('site').text
    state = apinfo.find('state').text
    apinfo_dict[stationId] = [site,state]

 

Once done, the whole section should look like this;

root = ET.fromstring(content) #Process XML data returned from FAA

for apinfo in root.iter('Station'):
    stationId = apinfo.find('station_id').text

if stationId[0] != 'K':
    site = apinfo.find('site').text
    country = apinfo.find('country').text
    apinfo_dict[stationId] = [site,country]

else:
    site = apinfo.find('site').text
    state = apinfo.find('state').text
    apinfo_dict[stationId] = [site,state]

 


   
ReplyQuote
Bogdan
(@bogdan)
Active Member
Joined: 3 years ago
Posts: 12
 

Hi Mark,

Thanks for this amazing project! I live in Moscow and would like to build a map which would be usable in GA in Russia. The problem is that official METAR is reported only by large airports. Smaller airports which are vastly used by small aviation don't report METAR/TAF. However there is a solution called "Autotaf" which generates the metar/taf code for all smaller airfields (actually works worldwide and the tool might be useful for future globalization of your software in Europe and other places of the world with no such developed small general aviation as in US).

Example: UUDN airfield which doesn't report weather: http://meteocenter.asia/?m=m&p=UUDN (or open via google translate https://meteocenter-asia.translate.goog/?m=m&p=UUDN&_x_tr_sch=http&_x_tr_sl=ru&_x_tr_tl=en&_x_tr_hl=ru).

My question is how difficult and whether it's actually possible to implement this into your software? If it's doable, could you kindly guide me which file should be amended? Thanks in advance!

-Bogdan

This post was modified 3 years ago by Bogdan

   
ReplyQuote
Mark Harris
(@markyharris)
Member Admin Registered
Joined: 5 years ago
Posts: 559
 

Hi, 

I looked at the links you provided and I didn't see an API available and the autotaf.me site wouldn't display any information. So I'll look at autotaf.me again later to see if the site was only down but without an XML feed or an API available from the site, we would have to scrape the data from the website itself which may work for a while, but as soon as they change anything on the site it would break the livesectional code.

So if you can find out if they have and XML feed or API we could play with, that would help. - Mark


   
ReplyQuote
Bogdan
(@bogdan)
Active Member
Joined: 3 years ago
Posts: 12
 

@markyharris I will talk to the author if he can provide any kind of API or XML feed. If not, will ask him if he is going to change structure and why the english version of this site (autotaf.me) doesn't work while the original Russian (meteocenter.asia) works. Will tell you about the result here.


   
ReplyQuote
Bogdan
(@bogdan)
Active Member
Joined: 3 years ago
Posts: 12
 

@markyharris hi! I have talked to them - they will be able to create an API for our purpose. For better results they would need an exhaustive list of most commonly used airports in order for the up-front generation of forecasts by using cron tasks. 

With regards to the content they can generate, it’s obviously not actual weather like in METAR, but it’s automatically modeled forecasts in TAF format for any airfield. What they already have is that based on the “big” forecast, they every hour generate so called “Nowcast” - the pseudo actual weather. So this Nowcast should be used instead of METAR for those airports which don’t have weather reporting. And their TAF can be used for 3-6-9 hours forecasts as per builder’s choice. So for those airports the update frequency would be an hour but it’s still much better than nothing.

With regards to the English version of service placed on the autotaf.me, they’ll look at it and will fix. I’ll let you know.


   
ReplyQuote
Bogdan
(@bogdan)
Active Member
Joined: 3 years ago
Posts: 12
 

The Nowcast format is something very close to real METAR and should be easy to interpret:

NOWCAST.SU UWWW 3011/3013 14003MPS 9999 BKN008 M10/M11 Q1027 ICE: MOD FL50/FL90 FBL FL10/FL120
 FM301200 14003MPS 9999 BKN008 M10/M11 Q1026 ICE: MOD FL50/FL90 FBL FL10/FL110
 FM301300 14003MPS 9999 BKN008 M10/M11 Q1026 ICE: MOD FL50/FL90 FBL FL10/FL110=

This post was modified 3 years ago by Bogdan

   
ReplyQuote
Mark Harris
(@markyharris)
Member Admin Registered
Joined: 5 years ago
Posts: 559
 

Sounds great. Let me know when they have their api ready to use. Preferably it would return an XML file with the pertinent weather data. At that point I can try to work it into the program, time permitting. 

autotaf.me worked for me this time. Thanks - Mark


   
ReplyQuote
Bogdan
(@bogdan)
Active Member
Joined: 3 years ago
Posts: 12
 

Hi Mark,

finally I’ve been able to get the first version of API which we discussed above. There are limited number of airports added into it for test purpose, but it will grow soon. 

This gives JSON: http://avia-meteo.ru/read_autotaf1.php?p=UUDD&mode=json

This gives simple database dump for clarity and testing/debugging: http://avia-meteo.ru/read_autotaf1.php?p=UUDD

List of airports included into this API as of now: http://avia-meteo.ru/st/st_icao.txt

Please let me know if that would be possible to modify the software so that for those airports which aren’t available through aviationweather.gov, the program would prompt to request this api for response to get current weather (nowcast) and forecasts (autotafs).

Many thanks!


   
ReplyQuote
Mark Harris
(@markyharris)
Member Admin Registered
Joined: 5 years ago
Posts: 559
 

Can the data be returned in XML format? All the code in the interpreter is expecting XML formatted data. It would be too time consuming to rewrite the interpreter. If we could get the data in XML then we could simply call for the data from AutoTaf rather than the FAA and let the interpreter do its thing. That should be relatively easy. But with Json, it would be too cumbersome. Let me know. - Mark


   
ReplyQuote
Bogdan
(@bogdan)
Active Member
Joined: 3 years ago
Posts: 12
 

@markyharris Hi Mark! Finally I have managed to get it done - the data for those smaller airports (not available via aviationweather) is now in XML as requested by you. Here is the sample live link: http://avia-meteo.ru/read_autotaf1.php?mode=xml&p=UUCT (for airport code, CASE sensitive all capitals). 

In the file structure you have so called nowcast which can be interpreted as METAR and autotaf which works as TAF for different time. Hope it’s clear with regards to the structure and decoding and easy to attach to the interpreter. Let me know if there’s something to clarify here. Easy page from the same service to assist with decoding: http://autotaf.me/?m=ge&p=UUCT

Here’s a preliminary list of airports to start with (will be expanded): http://avia-meteo.ru/st/st_icao.txt

Many thanks in advance!

Bogdan


   
ReplyQuote
Bogdan
(@bogdan)
Active Member
Joined: 3 years ago
Posts: 12
 

Also if needed they can put all airports into single file so that there's no need to send multiple queries for each airport separately.


   
ReplyQuote
Share: