2

I'm trying to work with a layer that uses a PostGIS geometry column of 3D polygons, but hit detection seems to be broken when trying to use the select tools. The geometry renders fine, but when I click on a feature using the highlight or identification tool the status bar in the bottom left reads "No features at this position found."

I can use ST_Force2D on the geometry, but I'd like to avoid having an extra calculated column on the original table. A view would work, but I need to be able to edit attributes of selected features, and I'm not sure how to do that or even if it can be done if my geometry column is from a view.

What's a good solution that will allow me to select features?

  • Is the layer active (selected) in the Layers panel? – Gabriel De Luca Mar 6 at 4:53
  • Yes. Everything works as expected if I use a view with geometry produced using ST_Force2D. – user3747260 Mar 6 at 4:56
  • I can't reproduce it. Drawing a simple MultiPolygonZ in a PostGIS enabled database, with all Z values other than zero, I can select and identify it in QGIS. Does the polygon have a valid geometry? Is it within the extents of the CRS? – Gabriel De Luca Mar 6 at 5:05
2

The issue here was an SRID mismatch. The geometry column was made with SRID 0, but the geometry itself was made with SRID 4326. When I created a view with a new ST_Force2D column, it correctly matched the SRID for the 2D column, hence why one worked and the other didn't.

Also it turns out QGIS has an error log, which clearly stated the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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