I have the following tables:
* Properties - a table containing land polygons, with a column
"Owner', containing the land owner's name.
* Points - a table containing locations, with a numeric column UnitID.
How do I query the point UnitIDs that are *not* within a property
polygon?
An illustration of this problem, as well as a tiny SpatiaLite database
containing the layers, is here: http://scruss.com/blog/2010/02/10/diary-of-a-geonumpty/
The example is trivial, but in real life I'm analysing several hundred
properties and points at once.
Many thanks,
Stewart
I poked around a bit with the dataset from your blog and came up with
this
select id,unitid from points where id not in (select points.id from
points, properties where within(points.geometry, properties.geometry))
I'm sure there is a better way to do this but this served the purpose
-Harsha
Thanks, that's great - it's not a huge problem to be solved, so it's
not like the nested query will take forever.
Much appreciated. Now to try it on the real dataset ...
cheers,
Stewart