I have created a Point dataset by using the Saga routine 'Convert Lines to Points'. This produces the following look and attribute table: Points in QGIS
Can anyone advise on how I can extract the maximum value from each 'ID' set (red polygon in image) and then add the correct XY position of that single (maximum value) point?
What I want to end up with is a list / table showing only the maximum value and XY coordinate for each cross line of points.
There are over 350 unique 'ID' sets within the attribute table, so the end table / file should contain 350 maximum values and coordinates.
Update... I have a shapefile of the data in question but I can't work out how to add it to this question! Can anyone advise please?
-
2Can you share your data, at least a sample? Like this, it's not clear to me what you have - and what you want to achieve: what should your final goal look like?Babel– Babel2021年09月17日 15:41:31 +00:00Commented Sep 17, 2021 at 15:41
-
I have a file to share with you but can't work out how to add it to the question or response (sorry, I am new to this forum). I'll see what I can do.Tim W– Tim W2021年09月20日 06:06:22 +00:00Commented Sep 20, 2021 at 6:06
-
You can't post files here, you must use an external fileshsring service and post the link here.Babel– Babel2021年09月20日 06:26:09 +00:00Commented Sep 20, 2021 at 6:26
-
I have now uploaded the sample file at the following link...we.tl/t-vX35UYZBrYTim W– Tim W2021年09月22日 06:17:17 +00:00Commented Sep 22, 2021 at 6:17
-
The final goal would be to have the initial dataset analysed to extract from each cross line of points the maximum value (height) with its associated XY coordinate. This dataset would then be a line providing the highest depth values.Tim W– Tim W2021年09月22日 06:23:51 +00:00Commented Sep 22, 2021 at 6:23
1 Answer 1
Use this expression in field calculator. Be aware: array_max
works only with QGIS versions 3.18 or higher:
array_max(
array_foreach (
array_filter(
map_akeys( attributes( )),
left (@element,1)='X'
),
eval(@element)
))
-
I have tried this but it results in an error... 'Expression is invalid'. I have tried both the text from above and also the text within your screen grab.Tim W– Tim W2021年09月20日 06:08:18 +00:00Commented Sep 20, 2021 at 6:08
-
What QGIS version do you use? Some parts of the expression work with newer versions only:
array_max
since QGIS 3.18: qgis.org/en/site/forusers/visualchangelog318/…Babel– Babel2021年09月20日 07:02:17 +00:00Commented Sep 20, 2021 at 7:02 -
I am currently using 3.16, so thanks for the response - I'll look at upgrading and testing the expressionTim W– Tim W2021年09月22日 06:10:49 +00:00Commented Sep 22, 2021 at 6:10