<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>Moin Nils,</p>
<p>diese Liste ist englisch, für deutsche Anfrage benutze besser
<a class="moz-txt-link-freetext" href="https://lists.fossgis.de/mailman/listinfo/fossgis-talk-liste">https://lists.fossgis.de/mailman/listinfo/fossgis-talk-liste</a></p>
<p>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.</p>
<p>Cheers, Hannes<br>
</p>
<div class="moz-cite-prefix">Am 13.09.21 um 17:12 schrieb Nils
Schneekloth:<br>
</div>
<blockquote type="cite"
cite="mid:AM0PR08MB515650F390C4B6C83F728382B8D99@AM0PR08MB5156.eurprd08.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Moin, ich wollte Open-sky- Daten in Qgis
visualisieren. Dazu habe ich versucht, den Ablauf von
<a
href="https://www.geodose.com/2020/09/realtime%20live%20data%20visualization%20qgis.html"
moz-do-not-send="true">
https://www.geodose.com/2020/09/realtime%20live%20data%20visualization%20qgis.html</a>
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: <o:p></o:p></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#'''<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#LIVE AIR
DATA TRAFFIC REQUEST<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#by ideagora
geomatics | <a href="http://www.geodose.com"
moz-do-not-send="true">
<span style="color:#4472C4">www.geodose.com</span></a> |
@ideageo<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#'''<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#IMPORTING
LIBRARIES<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">import
requests<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">import json<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">import csv<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">import time<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"><o:p> </o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#AREA EXTENT
COORDINATE GCS WGS84<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">lon_min,lat_min=-125.974,30.038<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">lon_max,lat_max=-68.748,52.214<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"><o:p> </o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#CSV OUPUT
PATH<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">csv_data='C:\Users\nschn\Documents\geodaten\Qgis\Flightdata\data.csv'<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"><o:p> </o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#REST API
QUERY<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">user_name=''<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">password=''<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">url_data='<a class="moz-txt-link-freetext" href="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)">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)</a><o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">col_name=['icao24','callsign','origin_country','time_position','last_contact','long','lat','baro_altitude','on_ground','velocity',
<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">'true_track','vertical_rate','sensors','geo_altitude','squawk','spi','position_source']<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"><o:p> </o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#REQUEST
INTERVAL<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">if user_name
!='' and password !='':<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
sleep_time=5<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">else:<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
sleep_time=10<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"><o:p> </o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">#GET DATA
AND STORE INTO CSV<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">while
col_name !='':<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> with
open(csv_data,'w') as csv_file:<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
csv_writer=csv.writer(csv_file,delimiter=',',quotechar='"',quoting=csv.QUOTE_ALL)<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
csv_writer.writerow(col_name)<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
response=requests.get(url_data).json()<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> <o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> try:<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
n_response=len(response['states'])<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
except Exception:<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
pass<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
else:<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
for i in range(n_response):<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
info=response['states'][i]<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
csv_writer.writerow(info)<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
time.sleep(sleep_time)<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">
print('Get',len(response['states']),'data')<o:p></o:p></span></i></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Anschließend habe ich das Script mit der
Python- Konsole geöffnet. Es erscheinen mehrere
Fehlermeldungen, die mir nichts sagen.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><i><span
style="color:#C55A11;mso-style-textfill-fill-color:#C55A11;mso-style-textfill-fill-alpha:100.0%">2021-09-13T16:42:51
WARNING Traceback (most recent call last):<br>
File
"C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\console\console.py",
line 653, in runScriptEditor<br>
self.tabEditorWidget.currentWidget().newEditor.runScriptCode()<br>
File
"C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python\console\console_editor.py",
line 451, in runScriptCode<br>
if self.syntaxCheck():<br>
File
"C:/Users/nschn/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\bettereditor\customclasses.py",
line 49, in syntaxCheck<br>
return check_syntax(self, filename,
fromContextMenu)<br>
File
"C:/Users/nschn/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\bettereditor\indicatorsutils.py",
line 33, in check_syntax<br>
if eline not in editor.bufferMarkerLine:<br>
AttributeError: 'Editor' object has no
attribute 'bufferMarkerLine'<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span
style="color:#C55A11;mso-style-textfill-fill-color:#C55A11;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></i></p>
<p class="MsoNormal">Kann mir eventuell jemand sagen, was ich
falsch mache?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ich arbeite mit Windows 10, 64 bit und QGIS
3.16.7<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><i><span
style="color:#C55A11;mso-style-textfill-fill-color:#C55A11;mso-style-textfill-fill-alpha:100.0%"><br>
</span> <o:p></o:p></i></p>
<p class="MsoNormal"><b><i><span
style="font-size:10.0pt;mso-fareast-language:DE">Nils
Schneekloth<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span
style="font-size:9.0pt;color:#2F5496;mso-fareast-language:DE">Ohldörp
81 - 24783 Osterrönfeld<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span
style="font-size:9.0pt;color:#2F5496;mso-fareast-language:DE">Fon:
+49 4331 6646278<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span
style="font-size:9.0pt;color:#2F5496;mso-fareast-language:DE">Mobil:
0151 20332942<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span
style="font-size:9.0pt;color:#2F5496;mso-fareast-language:DE">Email:
<a href="mailto:n.schneekloth@k-fo.de"
moz-do-not-send="true"><span style="color:#2F5496">n.schneekloth@k-fo.de</span></a><o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span
style="font-size:9.0pt;color:#2F5496;mso-fareast-language:DE"><o:p> </o:p></span></i></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
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
<a class="moz-txt-link-abbreviated" href="mailto:johannes.kroeger@wheregroup.com">johannes.kroeger@wheregroup.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.wheregroup.com">www.wheregroup.com</a>
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:
<a class="moz-txt-link-freetext" href="https://wheregroup.com/blog/">https://wheregroup.com/blog/</a>
---------------------------------------------
</pre>
</body>
</html>