[Qgis-user] Open-sky network

Johannes Kröger (WhereGroup) johannes.kroeger at wheregroup.com
Tue Sep 14 00:21:11 PDT 2021


Moin Nils,

diese Liste ist englisch, für deutsche Anfrage benutze besser 
https://lists.fossgis.de/mailman/listinfo/fossgis-talk-liste

The error hints at a different issue, you are using some third-party 
plugin "bettereditor" as editor in QGIS? First try without it please and 
see if the error persists.

Cheers, Hannes

Am 13.09.21 um 17:12 schrieb Nils Schneekloth:
>
> Moin, ich wollte Open-sky- Daten in Qgis visualisieren. Dazu habe ich 
> versucht, den Ablauf von 
> https://www.geodose.com/2020/09/realtime%20live%20data%20visualization%20qgis.html 
> <https://www.geodose.com/2020/09/realtime%20live%20data%20visualization%20qgis.html> 
> nachzustellen. Nun muss ich dazu sagen, dass ich von Python keine 
> Ahnung habe und das auch nur eine ergebnisoffene Spielerei ist. Ich 
> habe mir folgenden Code von der oben genannten Seite kopiert, eine *. 
> Csv- Datei erstellt und in Zeile 16 den Pfad zu der Csv- Datei in das 
> Script eingefügt:
>
> /#'''/
>
> /#LIVE AIR DATA TRAFFIC REQUEST/
>
> /#by ideagora geomatics | www.geodose.com <http://www.geodose.com> | 
> @ideageo/
>
> /#'''/
>
> /#IMPORTING LIBRARIES/
>
> /import requests/
>
> /import json/
>
> /import csv/
>
> /import time/
>
> //
>
> /#AREA EXTENT COORDINATE GCS WGS84/
>
> /lon_min,lat_min=-125.974,30.038/
>
> /lon_max,lat_max=-68.748,52.214/
>
> //
>
> /#CSV OUPUT PATH/
>
> /csv_data='C:\Users\nschn\Documents\geodaten\Qgis\Flightdata\data.csv'/
>
> //
>
> /#REST API QUERY/
>
> /user_name=''/
>
> /password=''/
>
> /url_data='https://'+user_name+':'+password+'@opensky-network.org/api/states/all?'+'lamin='+str(lat_min)+'&lomin='+str(lon_min)+'&lamax='+str(lat_max)+'&lomax='+str(lon_max)/
>
> /col_name=['icao24','callsign','origin_country','time_position','last_contact','long','lat','baro_altitude','on_ground','velocity', 
> /
>
> /'true_track','vertical_rate','sensors','geo_altitude','squawk','spi','position_source']/
>
> //
>
> /#REQUEST INTERVAL/
>
> /if user_name !='' and password !='':/
>
> /sleep_time=5/
>
> /else:/
>
> /sleep_time=10/
>
> //
>
> /#GET DATA AND STORE INTO CSV/
>
> /while col_name !='':/
>
> /    with open(csv_data,'w') as csv_file:/
>
> /csv_writer=csv.writer(csv_file,delimiter=',',quotechar='"',quoting=csv.QUOTE_ALL)/
>
> /csv_writer.writerow(col_name)/
>
> /response=requests.get(url_data).json()/
>
> //
>
> /        try:/
>
> /n_response=len(response['states'])/
>
> /except Exception:/
>
> /pass/
>
> /else:/
>
> /for i in range(n_response):/
>
> /info=response['states'][i]/
>
> /csv_writer.writerow(info)/
>
> /time.sleep(sleep_time)/
>
> /print('Get',len(response['states']),'data')/
>
> Anschließend habe ich das Script mit der Python- Konsole geöffnet. Es 
> erscheinen mehrere Fehlermeldungen, die mir nichts sagen.
>
> /2021-09-13T16:42:51     WARNING    Traceback (most recent call last):
>               File 
> "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\console\console.py", 
> line 653, in runScriptEditor
> self.tabEditorWidget.currentWidget().newEditor.runScriptCode()
>               File 
> "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\console\console_editor.py", 
> line 451, in runScriptCode
>               if self.syntaxCheck():
>               File 
> "C:/Users/nschn/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\bettereditor\customclasses.py", 
> line 49, in syntaxCheck
>               return check_syntax(self, filename, fromContextMenu)
>               File 
> "C:/Users/nschn/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\bettereditor\indicatorsutils.py", 
> line 33, in check_syntax
>               if eline not in editor.bufferMarkerLine:
>              AttributeError: 'Editor' object has no attribute 
> 'bufferMarkerLine'/
>
> //
>
> Kann mir eventuell jemand sagen, was ich falsch mache?
>
> Ich arbeite mit Windows 10, 64 bit und QGIS 3.16.7
>
> /
> /
>
> */Nils Schneekloth/*
>
> */Ohldörp 81 - 24783 Osterrönfeld/*
>
> */Fon: +49 4331 6646278/*
>
> */Mobil: 0151 20332942/*
>
> */Email: n.schneekloth at k-fo.de <mailto:n.schneekloth at k-fo.de>/*
>
> *//*
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

-- 
Johannes Kröger / GIS-Entwickler/-Berater
WhereGroup GmbH
Eifelstraße 7
53119 Bonn
Germany

Fon: +49 (0)228 / 90 90 38 - 36
Fax: +49 (0)228 / 90 90 38 - 11

johannes.kroeger at wheregroup.com
www.wheregroup.com
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
-------------------------------

---------------------------------------------
Schon gewusst?
In unserem Blog geben wir Tipps & Tricks zu
Open-Source-GIS-Software und berichten aus unserem Experten-Alltag:
https://wheregroup.com/blog/
---------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210914/8879a302/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xBF7B268A77C202D5.asc
Type: application/pgp-keys
Size: 2471 bytes
Desc: OpenPGP public key
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210914/8879a302/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 665 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210914/8879a302/attachment.sig>


More information about the Qgis-user mailing list