1

I am trying to merge two polygon shapefiles in QGIS 2.6.1.

  1. One is older one with all state boundary, which I have (.shp, .shx, .prj, .dbf).
  2. New one is downloaded from WEOGEO (.shp, .shx, .prj, .dbf ) and Coordinate ref system EPSG:4326 - WGS 84 - both.

In the newly merged shapefile the Polygon overlaps. If I set the transparency to high layer below is visible.

I thought of editing attribute table but, both have different attribute fields.

  1. The old one have field like ID, NAME, TYPE, LENGTH, AREA.
  2. But the new one OSM_ID, BOUNDARY, NAME, ADMIN_LEVEL

I am new to QGIS, how can I get the area and length of new polygon if I have to match attribute field of old.

  • I may have misunderstood, are you saying that the polygons in your newly merged layer overlap one another? – Joseph Feb 24 '15 at 12:32
  • Yes, the new polygon Comes below the old one. – shiv Feb 24 '15 at 13:04
  • 1
    A merge usually means that features from one shapefile is added to another - if a polygon was in the same location in both shapefiles and you merge them, you will get an output layer containing both those polygons so they will overlap. If you only want the area and length for the new polygons and don't want any overlaps then you can use the Field Calculator as mentioned. An alternative would be to use the Join by attribute table and select the Name field both for both layers (provided the name is consistent). – Joseph Feb 24 '15 at 13:13
1

Access the Field Calculator of the new polygon layer as shown in the image (or right-click the layer to access the attribute table and then access the field calculator from there) and create a new field called "Area". Set the Field type (I prefer Decimal as you can give a precision) and use the following command in the Expression:

$area

Field Calculator

Repeat the same steps for length and use the following command in the Expression:

$length

Hope this helps!

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.