[QGIS-Developer] QGIS processing model: extract specific attribute of a single feature to a string

Andreas Neumann a.neumann at carto.net
Tue Aug 11 01:47:45 PDT 2020


Hi Ujaval, 

Thanks for the "hacky" idea ;-) 

I am happy to report that it worked for me. 

For the long run, it would be good to have an algorithm to extract a
string from an attribute of a selected feature (something like
attribute(get_feature(expression_to_get_feature),attribute) ) or at
least an "Expression Executor" that outputs a string. Expressions can do
a lot, but getting a string output from an Expression seems to be
impossible. 

Anyway, I can progress now with the rest of my model. 

Thanks again, 

Andreas 

On 2020-08-11 10:15, Ujaval Gandhi wrote:

> I can think of a slightly hacky way. Use the 'Basic Statistics for Field' algorithm, and since your field will have a single value, use either the Minimum or Maximum value output from it (works for string fields too) as the parameter for another algorithm.
> 
> [1]
> 
> Ujaval Gandhi
> 
> Spatial Thoughts
> 
> mobile: +91-8095684687
> 
> email: ujaval at spatialthoughts.com
> 
> [2]   [3]  
> 
> Subscribe to our newsletter http://bit.ly/spatialthoughts-newsletter
> 
> On Tue, Aug 11, 2020 at 1:23 PM Andreas Neumann <a.neumann at carto.net> wrote: 
> 
>> Hi, 
>> 
>> In a model I aggregate values to a single feature. Then I would like to extract a specific aggregated attribute to a string so I can use it as the input parameter of another algorithm. 
>> 
>> I fail to find a way to do that. Aggregation works fine, string concatenation as well, but I fail to find a way to extract an attribute of a single feature to a string. 
>> 
>> Any ideas? 
>> 
>> I'm on QGIS 3.10, but if necessary I could also use a newer QGIS version. 
>> 
>> Thanks, 
>> 
>> Andreas _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

 

Links:
------
[1] https://spatialthoughts.com/
[2] https://www.linkedin.com/in/spatialthoughts/
[3] https://twitter.com/spatialthoughts
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200811/afe18e7e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: blocked.gif
Type: image/gif
Size: 118 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200811/afe18e7e/attachment.gif>


More information about the QGIS-Developer mailing list