https://issues.qgis.org/https://issues.qgis.org/favicon.ico2009-07-16T06:24:48ZQGIS Issue TrackingQGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176152009-07-16T06:24:48ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>Hi,</p>
<p>can you please attach here a shapefile so we can do further tests? Thanks!</p> QGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176162009-07-16T06:44:40ZGabriele Monfardini
<ul></ul><p>I've attached a shapefile with 3 empty geometries.<br />The attribute table is like that</p>
<p>Value | Number<br />aa | 1<br />bb | 2<br />cc | 0</p>
<p>I'm using qgis 1.2.0-Unstable Trunk at revision 11034.<br />The behavior is different from my first submission. Now the three rows are shown in the attribute table, but instead of the values they show the string "ERROR":</p>
<p>Value | Number<br />ERROR | ERROR<br />ERROR | ERROR<br />ERROR | ERROR</p>
<p>I don't know if the shapefile is exactly coherent with the shapefile format, I've created it with <a class="wiki-page new" href="https://issues.qgis.org/projects/qgis/wiki/ArcView">ArcView</a> GIS 3.2a</p> QGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176172009-07-16T06:59:27ZPaolo Cavallinicavallini@faunalia.it
<ul></ul><p>Confirmed. However, I do not see a real use case for what is essentially a non-spatial table: can you help us understanding?<br />Thanks</p> QGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176182009-07-16T07:20:18ZPaolo Cavallinicavallini@faunalia.it
<ul></ul><p>The non-null geom is visualized, and the record shown, the others not. Do you know of other software behaving differently?</p> QGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176192009-07-16T07:30:06ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>Hi,</p>
<p>I had the chance to try both the shapes you posted also on arcview 3.x and arcgis 9.x</p>
<p>On arcview 3.x they load fine and attribute tables show the records correctly. Arcgis 9.x works differently: in the first case it gives first a "general function failure" and then, when you open the table, a "error getting a list of OIDs from the table" and shows nothing. In the second case Arcgis 3.x gives directly a "error loading feature class" and do not load the shape.</p>
<p>On the other hand gvSIG seems to open correctly the table.</p>
<p>In what situations do you use such shapefiles? Maybe do you digitize at a later time a vector and then attach it to the table?</p> QGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176202009-07-16T07:40:47ZGabriele Monfardini
<ul></ul><p>Sometimes it happens to receive shapefiles with null features, but valid scalar data.<br />Sometimes the geometry is null by mistake and this, for example, may cause errors manipulating such features (i.e. importing or visualizing them).</p>
<p>So it would be useful to be able to inspect this features with qgis and see if the problem is caused by incorrect scalar data in the dbf or something else (corrupted uploaded file for example).</p>
<p>IMHO it is not an oddities to have a null geometry, it is not a "non-geometric" data.<br />AFAIK it is explicitly allowed by shapefile format to have null-geometries. <br />A null geometry is a perfectly legal geometry. Why this should prevent to inspect scalar data?</p>
<p>I think that the fact that dbf values related to null geometries are not shown is yet a bug, even if a minor one.</p> QGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176212009-07-18T05:18:41ZGabriele Monfardini
<ul></ul><p>I've added a crude patch to try to solve the problem.<br />(Is this the correct way to provide a possible patch?)</p>
<p>The idea is simple, to fetch only the attributes of the null-geometry row and to mark the feature as not valid to prevent problem with rasterization.</p>
<p>Obviously I don't know if setting mFetchFeaturesWithoutGeom( TRUE ) in qgsvectordataprovider.cpp is a good idea, maybe better solutions are possible that affects only the ogr provider.</p>
<p>The patch works with my test shapefiles.</p> QGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176222009-07-18T06:17:49ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>Thanks!</p>
<p>I changed the owner of the ticket, so Marco will have a look to your patch when he'll be back.</p> QGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176232009-08-02T01:02:56ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>The patch works.</p>
<p>The second part of the patch seems to have been already implemented somehow. It remains to apply the first part "mFetchFeaturesWithoutGeom( TRUE )", if obviously the developers think it is a good idea.</p> QGIS Application - Feature request #1290: Shapefile attribute tables do not show lines with null geometryhttps://issues.qgis.org/issues/1290?journal_id=176242009-08-03T11:47:24ZMarco Hugentoblermarco.hugentobler@sourcepole.ch
<ul><li><strong>Resolution</strong> set to <i>fixed</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in with modifications (kept <a class="wiki-page new" href="https://issues.qgis.org/projects/qgis/wiki/QgsOGRProvider">QgsOGRProvider</a>::featureAtId consistent with <a class="wiki-page new" href="https://issues.qgis.org/projects/qgis/wiki/QgsOGRProvider">QgsOGRProvider</a>::nextFeature).<br />Thanks for the contribution!</p>