I counted points in polygons in PostGIS like this
UPDATE hexagons SET count = (SELECT count(*) FROM points WHERE ST_Within(points.geom, hexagons.geom)); That came back with that
UPDATE 1554 That worked fine. It updated the new created column with the amount of points inside each polygon (6.6 mio points, 50k polygons). I started up QGIS to display the distribution of my points.
Well, I thought maybe something went wrong with my querry in PostGIS so I checked how many rows there are empty in my polygon layer. It turns out just two rows are empty.
What is weird though is that in the scale it only goes until 999 while there are rows which go well over 100000. I think that might be the problem. Whats going wrong here? Does QGis have problems with rows where the value is > 1000?
أكثر...
UPDATE hexagons SET count = (SELECT count(*) FROM points WHERE ST_Within(points.geom, hexagons.geom)); That came back with that
UPDATE 1554 That worked fine. It updated the new created column with the amount of points inside each polygon (6.6 mio points, 50k polygons). I started up QGIS to display the distribution of my points.
- right click on the layer
- properties
- style -> graduated -> picked my colorschema and so forth
- finally, I clicked okay and it looked like that (underlaying my point layer with which I did the 'Count Points in Polygon' in PostGIS with
Well, I thought maybe something went wrong with my querry in PostGIS so I checked how many rows there are empty in my polygon layer. It turns out just two rows are empty.
What is weird though is that in the scale it only goes until 999 while there are rows which go well over 100000. I think that might be the problem. Whats going wrong here? Does QGis have problems with rows where the value is > 1000?
أكثر...