I have a weird problem with QGIS trying to load a Layer from a Postgis Database

When I open the Layer from Postsgis I have two choices:

Method one:

Either, I use the Panel "Browser", where I can select PostGIS->myDatabase->public->myTable

then, I get a subset of the features in the table to be displayed in the main section (namely, only those features that have been edited via geoserver, but there is absolutely no trace of that in the datbase table). The subset consists of 338 features, while the whole table contains 5380 features.

When I rightclick the Layer's Name in the "Layer" Panel and select "open attribute table", I still get a List with all Features in the table, even those that are not displayed. When I select one of the non-displayed features and click the Loupe Icon ("zoom to the chosen cell"), It zooms to the place where the feature would be expected but is not displayed.

When I rightclick the Layer's Name and select "show numbers of object" it shows correctly 5402

But when I rightclick the Layer in the "Browser" Panel and select "properties", it says "Number of Objects within the layer":338

Method two

The second option I have is, open the layer with the Elephant-Icon on the left taskbar.

With this process, I get a layer where all 5402 features are correctly displayed - BUT:

When I try to select features in order to copy or move them, it works only with these 338 features from the other selection. The remaining 5064 features are simply not selectable. When I click on them after I selected the "select objects" button, nothing happens at all.


Even when I edit the values of on feature of the 5064 to resemble exactly the values of one of the 338 (except for Id), it is still not displayed in method one and not selectable in method two.

Everything worked fine before. Without any obvious reason, the program decided to behave like this.

Who can help?

Screenshot of info tab of the respective table enter image description here

  • How did you create the other features in PostGIS (as opposed to the ones that were edited)? My initial thought is the ones that are not coming in correctly may not have an SRID set or are similarly malformed. – Evil Genius Aug 19 '15 at 17:25
  • the features were all originally imported to the database from a shapefile via qgis. how can I check the srid? – Ferenjito Aug 20 '15 at 7:30
  • 1
    Use the database manager in QGIS (Database menu); when you browse to the PostGIS table in the tree, the 'info' tab has a "Spatial ref" entry which shows the SRID. – Simbamangu Aug 21 '15 at 9:33
  • If you export the data to a new shapefile, how many features are taken? – AndreJ Aug 21 '15 at 9:41
  • @Simbamangu: In the info tab, I dont see any information about "spatial ref", but in the table tree on the left hand, I see a table called "spatial_ref_sys". This contains a column called "srid" and about 4000 entries. How do I figure out now which of the entries are corrupt and belong to the broken features in my table? Asante sana! – Ferenjito Aug 21 '15 at 10:17

Your Answer

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

Browse other questions tagged or ask your own question.