1

I tried to use the Points in polygon tool in qgis 2.2.0 and it worked fine as long as I used my own points.

When I tried to 'count' the points generated from OSM layers both from dowloaded shapefiles from geofabrik - here I thought the problem is with the projection which is tricky to fix-, but then I downloaded the same points from the OpenLayers plugin with Vector > OpenStreetMap > Dowload data.

The result is the same. I generate the output grid layer but the PNTCNT coulmn is totally empty. Do you have any idea why? I am all new to qgis and these kinds of operations in general, so please explain me what am I doing wrong?!

underdark
  • 84,148
  • 21
  • 231
  • 413
mnprkk
  • 25
  • 3
  • Which CRS is the polygon data in? Did you reproject the OSM points to the polygon CRS? Note that on-the-fly reprojection is insufficient. – underdark Jun 08 '14 at 10:01
  • that could be the problem... I have 'on the fly' CRS transformation enabled and I set it at the project properties to WGS 84 / Pseudo Mercator as I read that it is required to show OSM data without distorsion. My polygon is also in WGS 84 / Pseudo Mercator. I also tried to change it to simple WGS 84 as the points are in that, but then they all 'disappear'.. so how do I reproject the points to the polygon CRS? – mnprkk Jun 08 '14 at 10:12
  • It is incorrect that OSM vector data requires Pseudo Mercator. This only applies to the prerendered raster tiles of OSM, Googlemaps and others. OSM vector data is provided in WGS84 EPSG:4326. – underdark Jun 08 '14 at 10:21

1 Answers1

0

For most spatial analysis tools to work, all layers have to be in the same CRS. Note that on-the-fly reprojection is insufficient.

If you need help on how to reproject vector data see: Reprojecting vector layer in QGIS?

underdark
  • 84,148
  • 21
  • 231
  • 413
  • Thank you! I reprojected the polygon and now it works fine! Now everything is in WGS84, however at the project preferences I still need to leave Pseudo Mercator otherwise everything is distorted. Anyhow, that is the next step to me to understand... – mnprkk Jun 08 '14 at 10:35