Sauf mention contraire dans les contenus, l'ensemble de ce site relève de la législation française et internationale sur le droit d'auteur et la propriété intellectuelle.
Le portailSIG est édité par l'association loi 1901 Forum Systèmes d'Information Géographique
dont le siège social se situe à AMIENS
ISSN 2274-4150
the point has no z coordinate
hi,
I tried to reproduce your code in my plugin for qgis:
in windows I always get this error:
"The point has no z coordinates"
this is my code:
on_tre_d_pressed def(self):
# layer.select ([])
# layer.setSelectedFeatures ([obj.id () for obj in layer])
# tre_d =''
mylayer = self.iface.activeLayer()
# tre_d (mylayer)
if self.tab_5.text() == "":
tab_5 = 0
else:
tab_5 = int(self.tab_5.text())
import loads from shapely.wkb
x = []
y = []
z = []
for elem in mylayer.selectedFeatures ():
geom = elem.geometry()
wkb = geom.asWkb()
data = loads(wkb)
x.append(data.x)
y.append(data.y)
z.append(data.z)
x = []
y = []
z = []
for elem in mylayer.selectedFeatures ():
geom = elem.geometry()
x.append(geom.asPoint()[0])
y.append(geom.asPoint()[1])
tab = "(z.append (elem.attributeMap()[%d].toFloat()[0]))"% int (self.tab_5.text())
eval(tab)
in the python console the error is intercepted near "z.append (data.z)"
Do you know why?
any idea?
thanks