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

Split multipolygon geometry fails #16271

Closed
qgib opened this issue Feb 27, 2013 · 18 comments
Closed

Split multipolygon geometry fails #16271

qgib opened this issue Feb 27, 2013 · 18 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Feb 27, 2013

Author Name: Csaba Sandor (Csaba Sandor)
Original Redmine Issue: 7244
Affected QGIS version: master
Redmine category:digitising
Assignee: Vincent Mora


Hi,

Splitting multipolygon spatialite geometries does not work as expected.

I try to split a geometry with 2 patches using edit/split features around the middle. (see attachment for cut line direction)

I get: @cut edges detected. Make sure the line splits features into multiple parts.@

If I convert the Multi to simple geometries it splits the geoms happily with the previous cutline.

It also works on geometries that are Multi in type but not Multi really.

With MultiLine geoms it also works although converts the split results to simple geoms which is still better than not doing it. :)

First tried on stable 1.8 then on 1.9 master.

Thanks for any views on this.
Csaba



Related issue(s): #16493 (relates)
Redmine related issue(s): 7550


@qgib
Copy link
Contributor Author

qgib commented Feb 27, 2013

Author Name: Giovanni Manghi (@gioman)


The split works fine for me on a newly created DB and vector on qgis master.

On the other hand if the vector was created with an autoincremental id (as qgis allows from the GUI), I get the following when trying committing the changes

Could not commit changes to layer teste1

Errors: ERROR: 2 feature(s) not added.
  SUCCESS: 2 geometries were changed.
  
  Provider errors:
  SQLite error: PRIMARY KEY must be unique
SQL: INSERT INTO "teste1"("geometry","pkuid","nome") VALUES (GeomFromWKB(?, 3003),?,?)

more over if the user discard the changes part of the "splitted" polygons do disappear.


  • subject was changed from Split multipolygon spatialite geometry fails to Split multipolygon spatialite geometry fails/errors
  • category_id was configured as Vectors
  • priority_id was changed from Normal to High
  • operating_system was changed from Windows 7 to
  • os_version was changed from Osgeo4W to
  • crashes_corrupts_data was changed from 0 to 1

@qgib
Copy link
Contributor Author

qgib commented Apr 7, 2013

Author Name: Olivier Dalang (@olivierdalang)


@giovanni Manghi : doesn't this deserve a specific issue thread ? (it's not clear if the two bugs are linked )
Also it should be fixed for 2.0 since it leads to data loss...

@qgib
Copy link
Contributor Author

qgib commented Apr 8, 2013

Author Name: Giovanni Manghi (@gioman)


Olivier Dalang wrote:

@giovanni Manghi : doesn't this deserve a specific issue thread ? (it's not clear if the two bugs are linked )
Also it should be fixed for 2.0 since it leads to data loss...

I agree, would you mind file a ticket? thanks.

@qgib
Copy link
Contributor Author

qgib commented Apr 8, 2013

Author Name: Olivier Dalang (@olivierdalang)


Ok here it is: #16493

@qgib
Copy link
Contributor Author

qgib commented Jun 2, 2013

Author Name: Giovanni Manghi (@gioman)


The original issue is still true, and I raise the priority because the tool is broken for multi part geometries.


  • priority_id was changed from High to Severe/Regression
  • subject was changed from Split multipolygon spatialite geometry fails/errors to Split multipolygon spatialite/postgis geometry fails

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2013

Author Name: Salvatore Larosa (@slarosa)


I cannot reproduce with PostGIS layer ! (spatialite not tested yet)
I tried it with a multipolygon features.

My testcase: http://lrssvt.ns0.it/img/multipolygon_postgis.sql

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2013

Author Name: Giovanni Manghi (@gioman)


Salvatore Larosa wrote:

I cannot reproduce with PostGIS layer ! (spatialite not tested yet)
I tried it with a multipolygon features.

My testcase: http://lrssvt.ns0.it/img/multipolygon_postgis.sql

it is still true, you must try split both parts of a multipart feature. Splitting of SL layers is broken see #16493


  • fixed_version_id was configured as Version 2.0.0
  • crashes_corrupts_data was changed from 1 to 0
  • category_id was changed from Vectors to Digitising

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2013

Author Name: Salvatore Larosa (@slarosa)


Giovanni Manghi wrote:

it is still true, you must try split both parts of a multipart feature. Splitting of SL layers is broken see #16493

ah, I only see the following message:

Cut edges detected. Make sure the line splits features into multiple parts.

is that what do you refer to ?

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2013

Author Name: Giovanni Manghi (@gioman)


ah, I only see the following message:

yes, this message is about this ticket (splitting the parts of a multipart geometry).

On the other hand when splitting a SL geometry you always get a message like

Could not commit changes to layer utm10

Errors: ERROR: 1 feature(s) not added.
  SUCCESS: 1 geometries were changed.
  
  Provider errors:
  SQLite error: PRIMARY KEY must be unique
SQL: INSERT INTO "utm10"("geom","pk","grel_","grel_id","id","amostra") VALUES (ST_Multi(GeomFromWKB(?, 32629)),?,?,?,?,?)

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2013

Author Name: Salvatore Larosa (@slarosa)


well, but I still don't understand the reason why this issue is a blocker for PostGIS provider too.
Also on 1.8 I get the same message and I think it is working as expected, or isn't ?

should not it be better to have two separate tickets ?

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2013

Author Name: Giovanni Manghi (@gioman)


Salvatore Larosa wrote:

well, but I still don't understand the reason why this issue is a blocker for PostGIS provider too.

because it happens also for postgis :)

Also on 1.8 I get the same message

it is the same on 1.8? if yes you can downgrade this, but I really think that all the (core) digitizing issue should be fixed for qgis 2.0

and I think it is working as expected, or isn't ?

no it isn't: while maybe is not a common operation a user could be very well need to split at the same time two parts of the same feature.

The issues are already in two different tickets:

this one is about splitting the parts of a multipart feature: the resulting message is at least misleading, but the optimal solution would be obviously allow shuch operation.

There is another ticket about the impossibility of splitting any SL feature, because of the error already reported.

Cheers!

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Jürgen Fischer (@jef-n)


Should be provider independant and is reproduceable with a multipolygon shape here too.


  • subject was changed from Split multipolygon spatialite/postgis geometry fails to Split multipolygon geometry fails

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Jürgen Fischer (@jef-n)


Jürgen Fischer wrote:

Should be provider independant and is reproduceable with a multipolygon shape here too.

The cut edge is the line between the part of the split line between the two polygons. Apparently that's ok in this case. So the pure existance of cut edges isn't a clear indication that the @GEOSPolygonize()@ will produce something ugly. May be should just check the validity of resulting polygon instead.

See alse http://lists.osgeo.org/pipermail/qgis-developer/2008-August/004549.html

@qgib
Copy link
Contributor Author

qgib commented Jul 11, 2013

Author Name: Vincent Mora (@vmora)


Here is a minimal test case for the issue.

Note that the split of one of the polygons in a multipolygon works and produces 2 new features (both parts of the split polygon).

Splitting at least two polygons of the polygons in a multipolygon produces the error.


  • 5973 was configured as test_qgsissue7244.py
  • assigned_to_id was configured as Vincent Mora

@qgib
Copy link
Contributor Author

qgib commented Jul 11, 2013

Author Name: Vincent Mora (@vmora)


Jürgen Fischer wrote:

The cut edge is the line between the part of the split line between the two polygons. Apparently that's ok in this case. So the pure existance of cut edges isn't a clear indication that the @GEOSPolygonize()@ will produce something ugly. May be should just check the validity of resulting polygon instead.

See alse http://lists.osgeo.org/pipermail/qgis-developer/2008-August/004549.html

I removed the check for cut edge and added a validity check as proposed. Works like a charm.

Note that I tried to create an invalid geometry (cut edge) by releasing the split tool inside the interior ring of a polygon and wasn't able to cut it.

@qgib
Copy link
Contributor Author

qgib commented Jul 11, 2013

Author Name: Vincent Mora (@vmora)


#717


  • pull_request_patch_supplied was changed from 0 to 1

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Jürgen Fischer (@jef-n)


Fixed in changeset "6272274fb5c9df63eaf1c94defc25a7aa8290cf7".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Vincent Mora (@vmora)


Bug fixed thanks to fundings from Agence de l'Eau Adour-Garonne.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality 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! Digitizing Related to feature digitizing map tools or functionality
Projects
None yet
Development

No branches or pull requests

1 participant