Hi Leigh,

A little SQL in the MapBasic window will do the trick.

Assuming your two point tables are named p1 and p2, and both have at least these two columns (add them if if necessary) :

- id - unique ID for each record
- dummy - any (preferably an integer column) un-initialized column, i.e. a column with the same values in both tables in all records (needed for cross join)

These three commands will select all points in p1 that lies at least 100 km from any point in p2:

*select p1.id "p1id", distance(objectgeography(p1.obj,1), objectgeography(p1.obj,2), objectgeography(p2.obj,1), objectgeography(p2.obj,2), "km") "dist12" from p1,p2 where p1.dummy = p2.dummy into DISTS

select p1id "p1id", min(dist12) "mindist12" from DISTS group by p1id into MINDISTS

select * from p1 where id in (select p1id from MINDISTS where mindist12 > 100)*

- command 1 generates a full table of p1-to-p2 distancies in km, using a full outer join (cross join)

- command 2 filters that list to leave only the minimal distance to p2 points for each point in p1

- command 3 selects the p1 points that has a minimum distance larger than 100 km

Feel free to modify to your needs.

HTH

Best regards / Med venlig hilsen
Lars Nielsen
GisPro



Leigh Bettenay wrote:

Can anyone help me with this simple little problem?



I have two point coverages and I want to identify all those points in
one table that are more than a specified distance from ANY point in the
other table.



I could do this by buffering one table, then identifying those points
inside buffered regions then inverting the selection. However, I suspect
there might be a quicker and sneakier way.



Any thoughts would be gratefully welcomed.





Leigh Bettenay
Chief Geologist
Sipa Resources Ltd

Level 2, 87 Colin St, WEST PERTH WA 6005
Tel: 08 94816259   Fax: 08 9322 3047
Mobile: 04388 17616
Email: [EMAIL PROTECTED]
===========================



_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to