8

I have a set of shapefiles grouped by regional area in Western Australia. What I want to do for visual purposes is add a consistent amount of space between each region. What's the best way to do this?

I can add everything into one shapefile, with attributes for regions, or split each shape further down into the lowest level, if either of those helps in getting this working.

Examples below should make what I mean clearer, obviously still needs work on borders, labels, etc.

My current map:
These are current state gov region groupings. I'm not sure if they're the groupings I'll finish with, so would one shapefile and an attribute table/filter work better for on the fly changes?

Current Map

Style Required:
Regions grouped and split to highlight that artificial grouping

Required Style

3

This solution will require some manual labor but it should work.

First, you should draw a buffer around each individual region using vector > geoprocessing tools > buffer(s) I believe your projection is EPSG 4283 which means your map units are in degrees, so you should choose a low buffer distance like 0.05. Use the same buffer distance for each region.

Then, in the print composer, add each region separately as a new map. Make sure the scale is exactly the same for each map, so that you don't lose accuracy (in the case below, I used 500,000) Lock the layers of each map so that they show only one region and it's buffer. Change the opacity of the background to 0 so that the regions are easier to fit together. Then piece the regions together manually so that their buffers align.

enter image description here

The last step is to go back and remove the buffer layers.

enter image description here

  • Upvoted as the added bonus of this approach is that you can include raster and detailed vector base maps in the final product without any problems – Andrew Tice Jan 3 '17 at 21:58
  • addendum - you'd style the buffers as inverted polygons with shapeburst filled to white if you wanted to include overlapping layers – Andrew Tice Jan 4 '17 at 0:00
  • I think I prefer this approach, as it's a little easier than experimenting with dx/dy values to get everything lined up, Though the other method does have the bonus of working outside composer. Is there a way in composer to see the map render as you move it? When I move a map item, the map tile disappears then re-renders once I release it. If there's a way to keep it visible while moving it around that'd make it much easier, similar to the windows "Show window contents while dragging window setting". – vbevan Jan 19 '17 at 5:25
8

With some trial and error, this may be a job for the Geometry Generators.

Start by creating some columns to hold the transformation in X and in Y.

enter image description here

Fill both columns with 0 for now.

enter image description here

Now, in the symbols, let's use a geometry generator that uses the dx and dy columns to make a translation.

enter image description here

Note: depending on the detail of your data, and your computer hardware, this can be heavy to render.

Now select some features and give them some values to move. I will exemplify with the pacific group, by moving them 100 km to West.

enter image description here

And here you go. all the selected states are now 100 km to the west (beware that my layer is in EPSG:5070 which units are meters).

enter image description here

Using this method, it's a question of trial and error to get the best dx and dy values for each state.

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.