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
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.
I poked around a bit with the dataset from your blog and came up with
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
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 ...