Skip to main content
Title changed, Content Structured
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

There are two layers

  • polygon BereichBerechnung'BereichBerechnung' with a field "Are_Number"
  • points EW2017'EW2017' with a field "EWjeAdr"

Example_of_data

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer BereichBerechnung'BereichBerechnung'.

I have found Updating field to give count of points in polygon using STIntersects? which seems related but I cannot figure out how to adjust my expression properly.

With this code:

SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data
  ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error:

Error

How can I do it?

There are two layers

  • polygon BereichBerechnung with a field "Are_Number"
  • points EW2017 with a field "EWjeAdr"

Example_of_data

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer BereichBerechnung.

I have found Updating field to give count of points in polygon using STIntersects? which seems related but I cannot figure out how to adjust my expression properly.

With this code:

SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data
 ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error:

Error

How can I do it?

There are two layers

  • polygon 'BereichBerechnung' with a field "Are_Number"
  • points 'EW2017' with a field "EWjeAdr"

Example_of_data

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer 'BereichBerechnung'.

I have found Updating field to give count of points in polygon using STIntersects? which seems related but I cannot figure out how to adjust my expression properly.

With this code:

SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error:

Error

How can I do it?

Focused question by removing call for hints/ideas and unnecessary expression of appreciation; added 18 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

There are two layers

  • polygon BereichBerechnung with a field "Are_Number"
  • points EW2017 with a field "EWjeAdr"

Example_of_data

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer BereichBerechnung.

I have found a related thread on this topic: STIntersects - Update field to give me count of points in polygon. Nevertheless,Updating field to give count of points in polygon using STIntersects? which seems related but I cannot figure it out how to adjust my expression properly, any suggestions?.

With this code:

SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data
ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error:

Error

Other smart suggestions/hints on how to aggregate values of a point layer based on polygons are also highly appreciated.How can I do it?

There are two layers

  • polygon BereichBerechnung with a field "Are_Number"
  • points EW2017 with a field "EWjeAdr"

Example_of_data

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer BereichBerechnung.

I have found a related thread on this topic: STIntersects - Update field to give me count of points in polygon. Nevertheless, cannot figure it out how to adjust my expression properly, any suggestions?

SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data
ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error

Error

Other smart suggestions/hints on how to aggregate values of a point layer based on polygons are also highly appreciated.

There are two layers

  • polygon BereichBerechnung with a field "Are_Number"
  • points EW2017 with a field "EWjeAdr"

Example_of_data

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer BereichBerechnung.

I have found Updating field to give count of points in polygon using STIntersects? which seems related but I cannot figure out how to adjust my expression properly.

With this code:

SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data
ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error:

Error

How can I do it?

Tiny adjustments
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

There are two layers

  • polygon BereichBerechnung with a field "Are_Number"
  • points EW2017 with a field "EWjeAdr"

Example_of_data

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer BereichBerechnung.

I have found a related thread on this topic: STIntersects - Update field to give me count of points in polygon. Nevertheless, cannot figure it out how to adjust my expression properly, any suggestions?

SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data
ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number
SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data
ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error

Error

Other smart suggestions/hints on how to aggregate values of a point layer based on polygons are also highly appreciated.

There are two layers

  • polygon BereichBerechnung with a field "Are_Number"
  • points EW2017 with a field "EWjeAdr"

Example_of_data

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer BereichBerechnung.

I have found a related thread on this topic: STIntersects - Update field to give me count of points in polygon. Nevertheless, cannot figure it out how to adjust my expression properly, any suggestions?

SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data
ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error

Error

Other smart suggestions/hints on how to aggregate values of a point layer based on polygons are also highly appreciated.

There are two layers

  • polygon BereichBerechnung with a field "Are_Number"
  • points EW2017 with a field "EWjeAdr"

Example_of_data

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer BereichBerechnung.

I have found a related thread on this topic: STIntersects - Update field to give me count of points in polygon. Nevertheless, cannot figure it out how to adjust my expression properly, any suggestions?

SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data
ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error

Error

Other smart suggestions/hints on how to aggregate values of a point layer based on polygons are also highly appreciated.

Structured, Title adjusted, One tag deleted and one tag added
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148
Loading
Tweeted twitter.com/StackGIS/status/1115857108120100867
deleted 22 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Loading
Code updated
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148
Loading
Question extended, Title improved
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148
Loading
Tiny adjustments
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148
Loading
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148
Loading