Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3187 closed enhancement (fixed)

transform ring into new polygon

Reported by: mlennert Owned by: jef
Priority: minor: annoyance Milestone: Version 1.7.0
Component: Python plugins and bindings Version:
Keywords: Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

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

Change History (9)

comment:1 by lutra, 13 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?

in reply to:  1 comment:2 by mlennert, 13 years ago

Replying to 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

comment:3 by volter, 13 years ago

Component: Build/InstallVectors
Owner: changed from nobody to jef

comment:4 by pcav, 13 years ago

Component: VectorsfTools
Resolution: fixed
Status: newclosed

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

in reply to:  4 comment:5 by mlennert, 13 years ago

Resolution: fixed
Status: closedreopened

Replying to 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

comment:6 by p0cisk, 13 years ago

Component: fToolsPython plugins and bindings
Resolution: fixed
Status: reopenedclosed

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.

in reply to:  6 ; comment:7 by mlennert, 13 years ago

Replying to 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

in reply to:  7 ; comment:8 by lutra, 13 years ago

Replying to mlennert:

Replying to 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...

in reply to:  8 comment:9 by mlennert, 13 years ago

Replying to lutra:

Replying to mlennert:

Replying to 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

Note: See TracTickets for help on using tickets.