1

Using QGIS 2.18.17, I'm trying to count the points in this polygon but I'm not able to do it. What I have done:

  • Loaded mapbox map (EPSG:3857)
  • Loaded CSV-file with the points (EPSG:32633)
  • Used georeferencing for the shapefile (EPSG:3857)

When I try to count the points in the polygon / shape, it processes for a long time but when I open the attributes table there is no data there. I think it might have to do with the shapefile being EPSG:3857 and the CSV-points being EPSG:32633, even if it's still correctly positioned (see image). Anyone have a clue of what I'm doing wrong?

qgis

1
  • They only appear to be "correctly aligned" in the image because Qgis is transforming the coordinates on the fly. If you examine the coordinates within each file you will discover that they dont correspond in space. They do not "overlap" so count = 0. Everything MUST be in the same CRS. Also, i noticed a consistent rectilinear pattern to those points. Do they actually occur in those locations in real life, or is that layer already an averaged approximation? this will have implications for the conclusions drawn from the results of your processing.
    – Marshall
    Aug 20 '18 at 16:24
6

Some processing algorithms are external commands, so they take only the input files and don't know about the on-the-fly reprojection you see in your canvas.

To get the result you want, reproject the point CSV to a shapefile with the same CRS as the polygon, then do the counting.

0
6

To expand on AndreJ's answer - in QGIS 2.x ALL processing algorithms required that the all inputs use the same CRS.

This has been improved in QGIS 3.0, in which all of the native algorithms will automatically handle mixed CRS without issue. (Native algorithms are all the ones which aren't provided by 3rd party libraries, such as GDAL, GRASS, SAGA or via plugins).

Not the answer you're looking for? Browse other questions tagged or ask your own question.