<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Calvin,</p>
<p>you might use<br>
</p>
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Consolas',monospace;font-size:9,8pt;">feature.geometry().get().z()</pre>
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Consolas',monospace;font-size:9,8pt;">
</pre>
<div class="moz-cite-prefix">Am 18/01/2022 um 15:27 schrieb C
Hamilton:<br>
</div>
<blockquote type="cite"
cite="mid:CABPxTTqh+VK=7ohNYt6gY5d6+g9HF0SahWXX7tk4uO2BQb8iRQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">As I iterate through a point vector layer I get
each feature. Normally I would get access to the coordinate
with
<div> pt = feature.geometry().asPoint()</div>
<div>Unfortunately, this is a QgsPointXY and not a QgsPoint and
I need to have access to the Z attribute. There is no function
to return a QgsPoint that includes the Z and M values. </div>
<div><br>
</div>
<div>If I do feature.geometry().get() there are member functions
such as addZValue(), dropZValue (), but there is no
getZValue(). </div>
<div><br>
</div>
<div>There is a function called vertexAt(QgsVertexId id)
which returns a QgsPoint, but the documentation is very
unclear on how to actually use this. What really is
QgsVertexId and how should it be constructed? Alternatively
there is vertices() or vertices_begin () which are iterators
that potentially could be used.</div>
<div><br>
</div>
<div>This all seems awkward and not documented well. What is the
best way to get a QgsPoint from a point feature which is
coming from a processing script like this?</div>
<div><br>
</div>
<div> iterator = source.getFeatures()</div>
<div> for cnt, feature in enumerate(iterator):<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Calvin</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
QGIS-Developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Benjamin Jakimow, Doctoral Researcher
Earth Observation Lab | Geography Department | Humboldt-Universität zu Berlin
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:benjamin.jakimow@geo.hu-berlin.de">benjamin.jakimow@geo.hu-berlin.de</a>
phone: +49 (0) 30 2093 6846
mobile: +49 (0) 157 5656 8477
fax: +49 (0) 30 2093 6848
mail: Unter den Linden 6 | 10099 Berlin | Germany
room: 2'211
web: <a class="moz-txt-link-freetext" href="https://hu-berlin.de/eo-lab">https://hu-berlin.de/eo-lab</a></pre>
</body>
</html>