2

Is it possible so automatically generate attributes when drawing new polygons?

Lets say i draw a large polygon thats fills a whole area/city in layer "A", and give it the attributes i wanted like city name, owner etc.

Is it possible when drawing new smaller polygons inside the larger polygon, either in the same layer or maybe layer "B", to automatically give the new polygons the same attributes that the large one has?

This would save lots of time when a bunch of new features has to be drawn with the same attributes.

  • If you install the multipart split plugin and you have a lot of attributes to copy and all the polygons are separate here's a trick. Draw all the new polys merge them all with the one poly with the attributes, then explode (multipart split) them back into separate polygons. In your case where the large polygon overlaps you might first create a separate poly off to the side, merge and explode it with you big poly, then use this off to the side poly to merge with all your new ones before exploding and then deleting it. – johns Apr 12 '18 at 12:42
  • If you have QGIS 3.0 it is even easier, there is a Merge attributes of selected features button on the advanced digitizing toolbar. – johns Apr 12 '18 at 12:51
  • The merge attributes button is not new, older versions of QGIS have it as well. – csk Apr 12 '18 at 18:08
2

You should instead use field calculator for this: You can first draw all the polygons and then you can select those where you want common attribute and use field calculator. , change your working style a bit and it will work.

0

Use the Merge Attributes button to copy attributes between features

Create the first feature, and fill in all the attributes. enter image description here

Create additional features, leaving the attributes blank. enter image description here

Select all features that you want to have the same attribute values.

Click the Merge Attributes button on the Advanced digitizing toolbar enter image description here

In the Merge Feature Attributes dialog window, select the feature which has attributes and click "take attributes from selected feature." enter image description here

Now all of the selected features have the same attributes, copied from the first feature.

enter image description here

If any of the features needs unique attributes, you can edit those now.


Note: The Merge Attributes button is available in the most recent version of QGIS (3.0) and in older versions at least as far back as 2.8.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.