2

I have a shapefile of a country with the 29 provinces. I also have shapefiles with the areas which are protected from construction (there are 4 categories for protection, within 4 shapefiles. Some of the protected areas belong to more than one category). I have also created a shapefile which is the buffer of the electrical transmission lines.

I would like to work out the area within each province which is maximum 20km from transmission line, minus the protected areas. (This is so I can eventually work out the maximum area available for solar panels.)

I am using QGIS.

My method is like this:

  1. Dissolve the shapefiles for protected areas (as they are broken up by name, etc, but I am not interested in this, only the total area). I have done this by creating a new column ("One") in the attribute table that has the value "1" for each entry and dissolved by this attribute because I cannot figure out a better way. I have then deleted all other attributes since I think they are slowing things up when I am doing other things (maybe this is wrong?)

  2. Merge the 4 dissolved protected areas. With the new layer I dissolve again to get rid of any overlapping features. I am now left with a shapefile of the protected areas which has an empty attributes table.

The next step is where I am getting stuck. This is what I expected to work:

  1. Clip The protected areas layer by the transmission buffer layer. I hoped that this would leave me with a shapefile that has only the protected areas that lie within transmission line buffer area. However this does not work because the resulting layer has an empty attribute layer and therefore cannot be seen.

What am I doing wrong here?

I would eventually like to: - Create a shapefile of the non-protected area within the transmission buffer area (I expect this would be by using Difference?) - Split this by province (I have tried to use Join by Attribute but it is not working)

  • The steps you use sounds fine to me, I did something similar before. Not sure why you cannot clip the buffer layer with the merged shapefile as your result should have attributes (unless they do not overlap at all). Which QGIS version are you using and are you able to upload your merged and buffer shapefiles in a public server for others to test? – Joseph Jul 8 '15 at 9:09
  • I'm using 2.8.2 (just downloaded this week). According to what I can see on my screen they overlap a lot (and I've reprojected both into the same CRS to be certain this isn't the issue). I've uploaded the files here:dropbox.com/sh/fofewndnj8wa580/AAA07GyIM9GG7luy7vc4mavTa?dl=0 (apologies for the Spanish!) – JackJ Jul 8 '15 at 11:32
  • I'll take a look at your data tonight, but there may be some invalid geometries that are causing issues. Currently I am clipping an dataset with another and getting an empty output, and the dataset was incorrectly edited so I have self intersections issues etc – lolcat Jul 9 '15 at 4:55
  • Yes - you're right - it's overlapping polygon that were created when I did the merge. I'm not sure how to get rid of these - I've tried union instead of merge (same problem) and dissolve (loses some of the polygons so the total area is reduced). I've tried v.clean in GRASS but it also doesn't do the job. – JackJ Jul 9 '15 at 10:32
1

Have you checked that the transmission buffer and the merged datasets are in the same coordinate system?

Also with your dissolve in the dissolve field, select dissolve all if you want to dissolve everything in that dataset to one polygon.

Lastly have you tried Union instead of merging them as merge will give you 4 overlapping polygons whereas in Union where they overlap you will have a new polygon with the attributes of both polygons in that area (sorry my explanation isn't great - google the difference and you will see).

  • Thanks, I have reprojected every layer using Save As just to be sure they are all in the same CRS. The problem I have with dissolve all is that it takes far too long (in excess of 2 hours before I cancel it) whereas making a dummy column with just a 1 in it (and deleting all other attribute columns) speeds things up considerably. But what is the downside of doing this? Am I losing something vital? I will try the union rather than merge- that makes sense thanks. – JackJ Jul 8 '15 at 8:37
  • Just update - union doesn't get rid of the overlapping regions so is not much use. If I use union and then dissolve all random sections are missing from the new shapefile. I can't understand what it is about the dissolve function that makes sections disappear. – JackJ Jul 8 '15 at 21:41

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.