diff --git a/Probleme.txt b/Probleme.txt new file mode 100644 index 0000000..3a15a39 --- /dev/null +++ b/Probleme.txt @@ -0,0 +1,2 @@ +Beim hinzufügen von Features fehlte das layer.updateFields() +Beim hinzufügen von Features fehlte wurde versucht eine viel zu große Pegelonline 'number' in einen Int zu stecken. War schwierig zu entdecken => provider.errors() \ No newline at end of file diff --git a/pomodules/pocurrentw.py b/pomodules/pocurrentw.py index 54cd4e6..4820c68 100644 --- a/pomodules/pocurrentw.py +++ b/pomodules/pocurrentw.py @@ -20,8 +20,8 @@ class PoCurrentW(object): stations = [] for station_json in stations_json: - if 'longitude' not in station_json or 'latitude' not in station_json or 'km' not in station_json: - print("getCurrentW: WARN: Station hat fehlende Attribute: %s" % (station_json['longname'],)) + if 'longitude' not in station_json or 'latitude' not in station_json: + print("getCurrentW: WARN: Station hat fehlende Koordinaten: %s" % (station_json['longname'],)) continue stations.append( diff --git a/pomodules/poqgscurrentw.py b/pomodules/poqgscurrentw.py index 8476afe..1133184 100644 --- a/pomodules/poqgscurrentw.py +++ b/pomodules/poqgscurrentw.py @@ -17,7 +17,7 @@ class PoQgsCurrentW(PoCurrentW): self.fields = QgsFields() self.fields.append(QgsField('shortname', QVariant.String)) - self.fields.append(QgsField('number', QVariant.Int)) + self.fields.append(QgsField('number', QVariant.LongLong)) self.fields.append(QgsField('agency', QVariant.String)) self.fields.append(QgsField('timestamp', QVariant.DateTime)) self.fields.append(QgsField('value', QVariant.Double)) diff --git a/pomodules/poqgsstations.py b/pomodules/poqgsstations.py index 4b549f2..a99e172 100644 --- a/pomodules/poqgsstations.py +++ b/pomodules/poqgsstations.py @@ -17,7 +17,7 @@ class PoQgsStations(PoStations): self.fields = QgsFields() self.fields.append(QgsField('uuid', QVariant.String)) - self.fields.append(QgsField('number', QVariant.Int)) + self.fields.append(QgsField('number', QVariant.LongLong)) self.fields.append(QgsField('shortname', QVariant.String)) self.fields.append(QgsField('longname', QVariant.String)) self.fields.append(QgsField('km', QVariant.Double)) diff --git a/pomodules/postations.py b/pomodules/postations.py index 52c1bd3..d585c3c 100644 --- a/pomodules/postations.py +++ b/pomodules/postations.py @@ -20,15 +20,18 @@ class PoStations(object): stations = [] for station_json in stations_json: - if 'longitude' not in station_json or 'latitude' not in station_json or 'km' not in station_json: - print("getStations: Station hat fehlende Attribute: %s" % (station_json['longname'],)) + if 'longitude' not in station_json or 'latitude' not in station_json: + print("getStations: WARN: Station hat fehlende Koordinaten: %s" % (station_json['longname'],)) + continue + if 'km' not in station_json: + print("getStations: WARN: Station hat fehlende km: %s" % (station_json['longname'],)) continue stations.append( { 'geometry': { - 'longitude':station_json['longitude'], - 'latitude':station_json['latitude'], + 'longitude': station_json['longitude'], + 'latitude': station_json['latitude'], }, 'attributes': { 'uuid': station_json['uuid'],