I have two datasets, both with about 1 million points per dataset (lets call them A and B). I'd like to know, for each point in A, what the closest point in B is (e.g. a spatial join). I can (and am) doing this with the brute force method that ArcMap seems to use (e.g. comparing each point to every other point, which is a 1,000,000^2 searches), but is there any way to do this more efficiently? Would a postgis database (queried through GRASS) work better? Does GRASS even have a gui for doing postgis queries? Thanks!
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
Cell: 415-794-5043
AIM: jgrn307, MSN: jgrn307@hotmail.com, Gchat: jgrn307
On Wednesday 09 April 2008, Jonathan Greenberg wrote:
I have two datasets, both with about 1 million points per dataset (lets
call them A and B). I'd like to know, for each point in A, what the
closest point in B is (e.g. a spatial join). I can (and am) doing this
with the brute force method that ArcMap seems to use (e.g. comparing
each point to every other point, which is a 1,000,000^2 searches), but
is there any way to do this more efficiently? Would a postgis database
(queried through GRASS) work better? Does GRASS even have a gui for
doing postgis queries? Thanks!
--j
I would use PostGIS for this task. You could use bounding boxes and a spatial
index to reduce the search to only the local points. like this:
for each point:
select the minimum distance from
(select the distance from all points to points of interest from
(select points within 100 m from your point of interest)
)
--
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341