<div dir="ltr">Thanks,<div><br></div><div>I was looking at get() returning QgsAbstractGeometry not realizing that this abstract geometry was really the QgsPoint.</div><div><br></div><div>Best wishes,</div><div><br></div><div>Calvin</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 18, 2022 at 2:47 PM Benjamin Jakimow <<a href="mailto:benjamin.jakimow@geo.hu-berlin.de">benjamin.jakimow@geo.hu-berlin.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Hi Calvin,</p>
    <p>you might use<br>
    </p>
    <pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:Consolas,monospace">feature.geometry().get().z()</pre>
    <pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:Consolas,monospace"></pre>
    <div>Am 18/01/2022 um 15:27 schrieb C
      Hamilton:<br>
    </div>
    <blockquote type="cite">
      
      <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></fieldset>
      <pre>_______________________________________________
QGIS-Developer mailing list
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
</pre>
    </blockquote>
    <pre cols="72">-- 
Benjamin Jakimow, Doctoral Researcher
Earth Observation Lab | Geography Department | Humboldt-Universität zu Berlin

e-mail: <a href="mailto:benjamin.jakimow@geo.hu-berlin.de" target="_blank">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 href="https://hu-berlin.de/eo-lab" target="_blank">https://hu-berlin.de/eo-lab</a></pre>
  </div>

_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div>