Skip to content
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

Wrong number of records in table of attributes of 1_polygon in imported vectors with overlapping parts #15691

Closed
qgib opened this issue Oct 4, 2012 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Oct 4, 2012

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 6451
Affected QGIS version: master
Redmine category:grass
Assignee: Radim Blazek


Import in GRASS the sample (very simple) attached vector.

It has two partially overlapping polygons, so in GRASS you will get a 1_polygon and a 2_polygon.

The reported number of features is right (4), but using QGIS the table of attributes shows just 3 records (should be 4, as per the non topological vector model).

Of course if reexporting the vector to shapefile, the result will have 4 features and 4 records.


@qgib
Copy link
Contributor Author

qgib commented Dec 30, 2012

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from High to Normal

@qgib
Copy link
Contributor Author

qgib commented Jun 12, 2013

Author Name: Radim Blazek (@blazek)


I remember that we talked about it in Essen and it was like you described. I tried again now and I have got 4 records in the table but 1xA and 3xB instead of 2xA and 2xB. It seems that it changed with new vector iterators but it is still buggy.


  • assigned_to_id was configured as Radim Blazek

@qgib
Copy link
Contributor Author

qgib commented Jun 12, 2013

Author Name: Radim Blazek (@blazek)


Fixed in changeset "b532151c97121bf263e6055a36d99c646d391cae".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Jun 12, 2013

Author Name: Radim Blazek (@blazek)


The problem was that QgsGrassFeatureIterator was using GRASS geometry id as QGIS feature id, but GRASS geometry may be connected with multiple database records through multiple categories. I have changed it to use

@qgis_feature_id = grass_geometry_id * 1000000000 + grass_cat@

There is potential problem with such ids however. It wont work if such features are used (exported to different format, processed by plugin) by an application which does not support longlong feature ids. I was considering to scan first all geometries to find maximum number of cats per feature to multiply only by necessary factor (and use cat index within geometry instead of cat), but that would slow down start up. That will be probably necessary if you find it to be a problem.

In theory, the geometries linked to the same attributes, i.e. with the same cat, could be represented as multi type (multipoint,multiline,multipolygon) but because there is no limit how may geometries may have the same cat, it could result in huge geometries which could not be effectively handled by QGIS. This could be also scanned at beginning however and used if possible (most cases).

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS labels May 24, 2019
@qgib qgib added this to the Version 2.0.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS
Projects
None yet
Development

No branches or pull requests

1 participant