I want to assign points to areas, and I was using the spatial overlay feature. However the areas are overlapping and so points may fall into more than one area. When I run the spatial overlay points are assigned to only one area. The relationship is one point may have multiple areas, and one area will have multiple points.
See attached example file I have setup to demonstrate my issue. Any assistance here would be wonderful.
Many thanks in advance
I am running V8.0.30
Attachments: Example overlapping area issue.map
Try it with spatial query.
SELECT [Areas].[AreaName], [Points].[ID]
FROM [Points Grid 1000m] as Points, [WAMEX Areas] as Areas
This should produce the results of AreaName & Point IDs that fall within each of the areas.
Just great! Many thanks for your assistance here. I believe it has done exactly what I was chasing. I will look further into the query syntax to see how I might be able to add additional fields into the output, and alsohow to view the result spatially. Many thanks again
it is barebones, though you are welcome. in my opinion, learn a bit about the sql creation process for queries in 8, it will better prepare you for a version 9 transition. There is much and more that you can do that will work well in the UI transform bar, but one never knows when unexpected behavior emerges. often enough, there are multiple paths to solving these sorts of conundrums, might involve some brain twisting. I got the above from testing the example in the "Queries using Two Drawings" section of https://manifold.net/doc/mfd8/selecting_objects_with_queries.htm
Thank you so much for pointing me towards the manifold help notes. Exactly what I was chasing to help me understand the solution. I see the query results are live, and link back to the tables and the map layer - just awesome. The solution is just so powerful, yet so simple.
Would it be possible to do a similar thing with two overlapping areas, rather than Areas and points. Any comments most welcome. Maybe something like this?? This does not run.
SELECT [Areas].[AreaName], [Areas].[TenID]
FROM [WAMEX Areas] as Area1, [Tenement] as Area2,
Many thanks for your prompt assistance here. I seem to have a syntax issue still. Something not quite right. I have added in the second area to the example attached. Apologies I did not originally include a map file for example.
PerhapsI should have also indicated that the areas will overlap and not be totally contained as was the case for the points. Perhaps I need to use a different function than "Contains". Just a thought
Very much appreciate the assistance here
Attachments: Example overlapping area issue 2 Query.map
Fix three typos (in bold) and then it runs:
SELECT [Area1].[AreaName], [Area2].[TenID]
FROM [WAMEX Areas] as Area1, [Tenement] as Area2 -- here
Typo 1: Areas -> Area1. Your FROM section says that there will be two tables, one with an alias of Area1, another with an alias of Area2. None use the alias of Areas.
Typo 2: Areas -> Area2. Same as above.
Typo 3: there was an extra comma where the comment 'here' is.
I don't think you want Contains(). That finds exactly what it says, an object which completely contains another. It does not detect overlaps except in the case of full containment (or identity).
If you want to detect partial overlaps, you need first to detect touching pairs of areas, then clip each touching to detect a residue.
Art's code also has a typo (a missing left square bracket in the last line).
Excellent. Many thanks for your comments here. Very much appreciated. I will stick to my points / area method for now.