3

I want to create a Postgresql view using point data. When I create the view, the geometry_columns table updates appropriately. Attempting to load in QGIS produces the error "(the_geom) sql = is an invalid layer and cannot be loaded".

For all of the working (polygon) views, when I load them in QGIS, I need to specify the primary key column (as documented here: How to make a spatial view in PostGIS and add it as a layer in QGIS?). When I try to add my point view, I am not given the option to choose the primary key.

I have tried several tables all with Point geometry and nothing is working. The tables do have the 3 constraints: enforce_dims_the_geom, enforce_geotype_the_geom, and enforce_srid_the_geom. I have also run st_isvalidreason (the_geom) and the geometry is valid. How do I get a view with point data to show the selection for a primary key in QGIS?

We are running PostGIS 1.4 and I am using QGIS 1.8.

asked Sep 25, 2013 at 16:12
1

1 Answer 1

3

Once you connect to the PostGIS db and a window appears with the list of available tables, if you scroll over to the right, there should be a column "Primary Key". For tables where QGIS doesn't recognize the PK, there should be a drop down so you can choose which column is the PK. If you have a column in the database table called "gid" which is a PK, then this should work without any need to manually choose the column.

answered Sep 30, 2013 at 5:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.