In Release 8 the Contains() function requires geoms as arguments, not numeric ID values. In Release 9 there is a GeomContains() function (not Contains), which also takes geoms as arguments (see the user manual). It's not clear what you mean by "select points into areas". When you write "wanting point IDs to be allocated into the Areas" it sounds like you want to do a spatial JOIN. I do all of those in 9, not 8, one reason being the really super Join dialog in 9. The easiest way to learn how to do a spatial join in 9 is to use the Edit - Join dialog to set up the join you want and then hit the Edit Query button so see the SQL it writes. If you're interested in joining a numeric ID field for points, then it seems you'd want to do a sum or some other aggregate operation. If you want a list of point IDs in each area, then you'd first create a text version of the ID field and join that, using the Join Tokens aggregate method. If what you want to do is selections, then use the Select pane with spatial selection, and use the Edit Query button to see the SQL it writes. Using the .map you attached, the query in 9 analogous to that in your post is: SELECT [Areas].[AreaName], [Grid 500].[ID] FROM [Areas], [Grid 500] WHERE GeomContains([Areas].[Geom (I)],[Grid 500].[Geom (I)], 0); (I don't use alias quite so much since it is easier to get confused with similarly named aliases...) However, that doesn't look particularly useful, since it looks like you have overlapping areas where multiple areas contain the same points. I get the feeling there is a better way to do whatever is the end objective for your project.
|