[Qgis-user] Query on QgsVectorLayer

Werner Macho werner.macho at gmail.com
Thu Apr 9 07:18:44 PDT 2020


Hi!

If you really only want the highest/lowest X-Value - what about
querying the Bounding Box of the layer?
Maybe that will also result in what you want.

regards
Werner

On Thu, 2020-04-09 at 13:37 +0200, Christoph Jung wrote:
> Hello everyone,
> 
> I have a question concerning PyQGIS. Imagine there is a point layer
> accessed via QgsVectorLayer, i.e. no matter which data source it is.
> Is it possible to query this layer to get the point object with the
> highest/lowest x-value in its geometry (similar to max-/min-aggregate 
> functions in SQL)? Or do  I have to iterate over all objects and
> compare the values by my own?
> 
> Sincerely,
> Christoph
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



More information about the Qgis-user mailing list