-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shapefile attribute tables do not show lines with null geometry #11350
Comments
Author Name: Giovanni Manghi (@gioman) Hi, can you please attach here a shapefile so we can do further tests? Thanks! |
Author Name: Gabriele Monfardini (@gabrimonfa) I've attached a shapefile with 3 empty geometries. Value | Number I'm using qgis 1.2.0-Unstable Trunk at revision 11034. Value | Number I don't know if the shapefile is exactly coherent with the shapefile format, I've created it with [[ArcView]] GIS 3.2a |
Author Name: Paolo Cavallini (@pcav) Confirmed. However, I do not see a real use case for what is essentially a non-spatial table: can you help us understanding? |
Author Name: Paolo Cavallini (@pcav) The non-null geom is visualized, and the record shown, the others not. Do you know of other software behaving differently? |
Author Name: Giovanni Manghi (@gioman) Hi, I had the chance to try both the shapes you posted also on arcview 3.x and arcgis 9.x 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. On the other hand gvSIG seems to open correctly the table. 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? |
Author Name: Gabriele Monfardini (@gabrimonfa) Sometimes it happens to receive shapefiles with null features, but valid scalar data. 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). IMHO it is not an oddities to have a null geometry, it is not a "non-geometric" data. I think that the fact that dbf values related to null geometries are not shown is yet a bug, even if a minor one. |
Author Name: Gabriele Monfardini (@gabrimonfa) I've added a crude patch to try to solve the problem. 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. 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. The patch works with my test shapefiles. |
Author Name: Giovanni Manghi (@gioman) Thanks! I changed the owner of the ticket, so Marco will have a look to your patch when he'll be back. |
Author Name: Giovanni Manghi (@gioman) The patch works. 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. |
Author Name: Marco Hugentobler (@mhugent) Applied in with modifications (kept [[QgsOGRProvider]]::featureAtId consistent with [[QgsOGRProvider]]::nextFeature).
|
Author Name: Gabriele Monfardini (@gabrimonfa)
Original Redmine Issue: 1290
Redmine category:data_provider
Assignee: Marco Hugentobler
I've seen Changeset 2020. Qgis do not crash anymore viewing shapefiles with records with null geometry.
But... this records are not shown.
Since null geometries are allowed by shapefile format and these records may carry useful data, they should be shown.
The text was updated successfully, but these errors were encountered: