Feature request #3187

transform ring into new polygon

Added by mlennert - over 9 years ago. Updated about 9 years ago.

Status:Closed
Priority:Low
Assignee:Jürgen Fischer
Category:Python plugins
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:13247

Description

It would be nice if it were possible to transform a ring into a polygon, i.e. to fill it.

For example: if you have a lake in a forest, you could first digitize the forest, then cut the ring where the lake is and then tell QGIS to fill this ring with a new polygon, instead of having to digitize the entire ring boundary again.

Moritz

History

#1 Updated by Giovanni Manghi over 9 years ago

try import the polygon (with the ring) into a GRASS mapset, you'll have automatically your rings placed into a polygon layer, then with "save as..." you can get out the mapset as shapfiles... is this enough?

#2 Updated by mlennert - over 9 years ago

Replying to [comment:1 lutra]:

try import the polygon (with the ring) into a GRASS mapset, you'll have automatically your rings placed into a polygon layer, then with "save as..." you can get out the mapset as shapfiles... is this enough?

This is the solution I currently give to people who are confronted with the issue, although it is not as automatic as you say: GRASS only recognizes a surface surrounded by boundary lines as area if it contains a centroid. A simple import with v.in.ogr does not insert such centroids automagically, you have to do that by hand with v.digit (or the QGIS GRASS digitizer) befor re-exporting the layer to shapefile.

So, no, I don't think this is really enough. It shouldn't be too difficult to add one (or more) of the several options

- "fill ring with a polygon"
- copy boundary lines for reuse in a new polygon. Currently, IIUC, when editing a polygon layer, you can only select and copy polygons, not boundaries.
- draw a polygon within an already existing larger polygon and to say that an island should be created in the larger polygon along the boundaries of the new one.

Just these little things that make life a bit easier...
;-)

Moritz

#3 Updated by Paolo Cavallini about 9 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

In trunk a "Lines to polygons" command has been added. Please check if this is what you need and reopne the ticket if not.

#4 Updated by mlennert - about 9 years ago

  • Resolution deleted (fixed)
  • Status changed from Closed to Feedback

Replying to [comment:4 pcav]:

In trunk a "Lines to polygons" command has been added. Please check if this is what you need and reopne the ticket if not.

Unless I don't understand your proposed solution, this is not a response to the original feature request. What I'm aiming at is something that will allow to easily digitize islands, i.e. smaller polygons comletely enclosed by larger polygons. QGIS already allows to create rings, i.e. holes in larger polygons. Thus the title of the feature request, as it might be a possible solution to allow the transformation of such rings into polygons. Other options would be possible, such as the possibility to declare a polygon as an island, thus "cutting" the larger polygon by the smaller polygon.

Currently, if you digitize both polygons, they just overlap. So, in order to get an island, you have to digitize the larger polygon, cut a ring into this polygon, and then correctly use snapping in order to digitize the smaller polygon exactly on the contours of the ring. Not impossible, but tedious and error-prone.

As mentioned in the comments, GRASS's data structure allows to do this almost automatically, as it does not allow overlapping features and so digitizing the smaller polygon over the larger polygon automatically cuts the hole into the larger polygon.

As I said, several options are available to solve this problem:

1) Allow declaring a ring as a new polygon, i.e. being able to say: this hole I just cut into my forest actually is a lake.

2) Allow to cut a ring with a new polygon, i.e. being to able to say: this polygon I just digitized is my lake and it should cut a hole into my forest

3) Allow to copy specific boundary lines, i.e. being able to say: take the boundaries of the hole I just cut into my forest and copy them as boundaries of a new polygon (my lake) I wish to create.

Moritz

#5 Updated by Piotr Pociask about 9 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed

Hi
Try to use plugin 'Ringer' from QGIS Contributed Repository (experimental).
Select polygons to transform there rings to polygons. If you didn't select any polygons, all rings will be converted.

#6 Updated by mlennert - about 9 years ago

Replying to [comment:6 p0cisk]:

Hi
Try to use plugin 'Ringer' from QGIS Contributed Repository (experimental).
Select polygons to transform there rings to polygons. If you didn't select any polygons, all rings will be converted.

I've installed and activated it, but it stays greyed out and non-active in the Extensions menu be it with polgons selected or without.

Moritz

#7 Updated by Giovanni Manghi about 9 years ago

Replying to [comment:7 mlennert]:

Replying to [comment:6 p0cisk]:

Hi
Try to use plugin 'Ringer' from QGIS Contributed Repository (experimental).
Select polygons to transform there rings to polygons. If you didn't select any polygons, all rings will be converted.

I've installed and activated it, but it stays greyed out and non-active in the Extensions menu be it with polgons selected or without.

Moritz

toogle editing...

#8 Updated by mlennert - about 9 years ago

Replying to [comment:8 lutra]:

Replying to [comment:7 mlennert]:

Replying to [comment:6 p0cisk]:

Hi
Try to use plugin 'Ringer' from QGIS Contributed Repository (experimental).
Select polygons to transform there rings to polygons. If you didn't select any polygons, all rings will be converted.

I've installed and activated it, but it stays greyed out and non-active in the Extensions menu be it with polgons selected or without.

Moritz

toogle editing...

dooh. ;-)
Works great, thanks !

Might be nice to be able to pop up the attribute form once a ring becomes a polygon, but don't know how this could be done when filling multiple rings at once...So, this is already a very nice solution as is.

Moritz

Also available in: Atom PDF