1

I desperately need to intersect two layers, one of 32 large polygons (towns) the other of many smaller areas with those towns, so that I can classify and make calculations on the smaller areas sorted by town.

I'm using the latest 1.24.3 Lyon version of QGIS (upgraded from V.1.24.1 today). The two layers are here:

http://stubmandrel.co.uk/images/Bits_and_pieces/QGIS_Sample_Files.zip

As you can see I have tried exporting to WGS84 (the project CRS) to ensure that they are overlapping and visible, Topology checker says no errors.

I am opening both latyers, can visually see they overlap, choosing geoprocessing tools>intersect, selecting both files with 'use selection' unchecked, and selecting a suitable filename for the output, but although the new layer is created, its attribute table is empty.

I have a few layers where I can get the clip command to work, but intersect always seems to fail. Previously I have been able to use the geoprocessing tools - using the data attached to do other things.

Can anyone see a fault in my data of workflow?

4
  • 300m buffer is not in WGS84 it is in EPSG:7405
    – Ian Turton
    Jan 21, 2016 at 13:36
  • I think this is more than a CRS issue as I cannot intersect them even though I reprojected both layers to the same CRS.
    – Joseph
    Jan 21, 2016 at 13:50
  • 1
    You are right @Joseph. I even get an error when reprojecting: Export to vector file failed.Error: Feature write errors
    – wiltomap
    Jan 21, 2016 at 14:06
  • Maybe you need to merge the polygons before you clip them.
    – Nikos
    Jan 21, 2016 at 14:48

4 Answers 4

4

This is a CRS issue. The CRS of layer named 300m_buffer_wgs84 is EPSG:7405, OSGB 1936 / British National Grid. What I suggest you to do is:

  1. Save this layer as another layer (change name) and specify CRS with EPSG:4326 (WGS84) before validating.

  2. Launch QGIS and disable On-the-fly reprojection (Settings > Options > CRS > Don't enable 'on the fly' reprojection). Also check that your project CRS is WGS84.

  3. Load your 2 layers: they should overlap correctly and the geoprocessing tools should also work.

3

I am reasonably new to this and struggled with the clipping not working also.I struggled for weeks. I read all sorts of ideas and passed over the solution many times.

It does work the key thing is the CRS of each layer has to be the same.People were saying re save the layer as the crs you want then re-bring it back into qgis again before clipping attempt. Here's the other vital missing piece that was also mentioned and i missed. At this time of re importing the layer You MUST uncheck " re project on the fly" this time or what happens is it tweaks it and you don't notice and once again your cookie cutter produces nothing.

As long as all layers including your cookie cutter are saved and imported into qgis as the same crs, then the clip works perfectly every time.

2

The 300m_buffer_wgs84 file is not WGS84, but EPSG 7405

3
  • 1
    I've put a more detailed answer about this issue.
    – wiltomap
    Jan 21, 2016 at 13:57
  • I felt it answered "Can anyone see a fault in my data of workflow?" but you are right. Jan 21, 2016 at 14:39
  • Indeed, i must have changed it when trying different permutations, but I still get a fail when the CRS matches. Jan 21, 2016 at 20:43
2

There seems to be some serious issues with your data excluding the CRS factor. As you have mentioned, the Clip tool works but Intersect does not.

As a workaround:

  1. Follow the answer provided by @wiltomap to reproject the shapefiles to the same CRS.

  2. Use the Clip tool with the buffer layer as your Input vector tayer and the town layer as your Clip layer

  3. Then use the Join attributes by location tool (Vector > Data Management Tools > Join attributes by location) and use the result from Step 2 as the Target vector layer and the same town layer as the Join vector layer. Also check the Keep all records to ensure the output contains attributes from both selected layers:

    Join attributes by location

The final result should be similar to what you would achieve if you used the Intersect tool (i.e. the clipped features will contain attributes from both layers):

Attribute Table of result

2
  • 1
    Thanks, I don't know how that layer ended up not being WGS84, I must have changed it back again when trying different permutations. I have followed your work-around and it has given me what I want. Now i just have to repeat this for about 15 more datasets! This will benefit the real world, we now know which Black Country Towns are most in need of more accessible greenspace for their residents! Jan 21, 2016 at 17:18
  • Good job @StubMandrel! And welcome to GIS StackExchange.
    – wiltomap
    Jan 21, 2016 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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