3

I have QGIS 2.8.2 Wien on windows 7 and quite new to QGIS. I have two shapefiles - 1 with rivers and 2 with sites located on some of those rivers. I want to carry out a spatial query to find the river sections that have sites located on them, but when I carry out the query, no sections are found, although there should be over 100 of them. I have checked that the CRS is the same on both layers (EPSG:29903 TM75 Irish grid), I don't know why results don't show up.

  • Perhaps this recent post might help in terms of a spatial query? – Joseph Jan 8 '16 at 13:00
  • Thank you Joseph appreciate your post suggestion, unfortunately doesn't solve my problem, no idea why spatial query reveals no results as I following exact procedure as tutorial found qgistutorials.com/en/docs/performing_spatial_queries.html – lynda Jan 8 '16 at 13:15
  • Most welcome! Have you tried using the Select by location tools? – Joseph Jan 8 '16 at 13:16
  • No I haven't used those tools before, if you think they might do the job I will look in to them, cheers – lynda Jan 8 '16 at 13:21
  • 2
    Can you share data or at least screenshots? There's not enough info to find the problem here. – underdark Jan 10 '16 at 0:27
2

Use Processing toolbox > select by location and choose intersects and choose a precision of 50 meters (or whatever buffer you think is appropriate.) Alternatively you could buffer the rivers with a 50m buffer (again or whatever is appropriate) then do a select by location of the points to the polygons and this time select within instead of intersects. This will select all points of interest that are on or near the river. Then export these set of points out and you are ready to go.

1

Maybe some geometries are not valid, can you check their validity with "Check Geometry Validity" Tool ?

If it's a validy problem, you can then fix them : Fixing geometry validity errors in QGIS?

  • Thank you all, very grateful for your suggestions, Yes Raphael I have 14 errors detected on the river layer. I'm sorry but I am new to QGIS and find the fixing in GRASS etc. hard to understand, is there a simple manual way I can fix these in QGIS? and are these errors the cause of spatial query not working? – lynda Jan 11 '16 at 8:28
  • Example of some of the errors: 16215,segments 37 and 39 of line 0 intersect at 161866.533227, 286650.581012 16215,Geometry has 1 errors. 18074,segments 17 and 19 of line 0 intersect at 180284.317251, 232181.656127 18074,Geometry has 1 errors. 37154,segments 12 and 14 of line 0 intersect at 168131.471373, 111254.379391 37154,Geometry has 1 errors. 39706,segments 12 and 14 of line 0 intersect at 236985.547856, 140262.754145 39706,Geometry has 1 errors. 50076,segments 10 and 12 of line 0 intersect at 300931.699705, 115366.440032 50076,Geometry has 1 errors. – lynda Jan 11 '16 at 8:30

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.