I am trying to merge two layers of a map which includes the state and county levels. I was able to edit the borders to look how I want, but when I merge them I am struggling to keep the style formatting.

This image is how I want them to look, with State level laid on top of Counties. I would like to export this as one shapefile. enter image description here

When I merge the Shapefiles, the map ends up like this. When I edit the borders of the states it now changes all the borders to thick black. enter image description here

Is there a way I can keep the formatting from how Image 1 looks, while merging the two shapefiles. Below are the two shape files without being overlaid.

enter image description here enter image description here

  • 1
    Which software are you working with? You can simply add a new field in each of your shapefile that will define the group of layers that follow a mutual border styling rule (in case if you don't any mutual parameter that refer to each shapefile). – Taras Mar 25 '19 at 14:55
  • Thanks Taras, I am working in QGIS 3.6.0, I have tried setting up a rule based styling for States and Counties which is how I got the Image above. Do you have any tips for creating a mutual border styling rule? Currently State/admn_1 and County/admn_2 are in separate columns – Robert Kovacs Mar 25 '19 at 14:59
  • 1
    Tips...I suspect I have already mentioned it above. Perfect if you have separate columns, than you can simply do Layer Properties -> Symbology -> Categorized – Taras Mar 25 '19 at 15:08

Make a column in your database that describes if a polygon is a county or state.

Layer properties > Source fields > start editing > New Field > example: Name: AREA_TYPE and Type: text(String) and Length: 10)

Manually state in attribute table which polygon is a county and which is a state, or use the field calculator (see example below)*

Use rule-based symbology with an expression to make the lines show as needed.

Layer properties > Symbology > Rule-based > make two entries:

  • one with rule: "AREA_TYPE"='county'
  • one with rule: "AREA_TYPE"='state'

apply style as you see fit per ruled symbol.

For example, I used the Field Calculator in a similar case:

WHEN $area < '[a value]' THEN 'county'
WHEN $area > '[a value]' THEN 'state'

This field calculator method works if your smallest state is larger then your largest county. You just have to find the value of your biggest county or smallest state.

Apply a value in the '[a value]' section that is slightly larger than your largest county, or slightly smaller than you smallest state. That can be found by using the information tool and look up the area of a polygon in the "derived" section.

| improve this answer | |

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.