teachcalds

Nearest Point to a Point

Discussion created by teachcalds on May 13, 2011
Latest reply on May 14, 2011 by teachcalds
HELP!!!! SOS!!!

OK ... Here's what I'm trying to do. I'm wondering if there is any type of extension out there that will take points from the first shapefile and find its nearest point in a second shapefile. Then take both and output them to a spreadsheet format (dbf or xls). Joining the attributes of the first file with the attributes of the second file.

I have a shapefile of Points and I want to find the closest point in another shapefile. The second shapefile can have a one to many relationship with the points from the first shapefile. The first shapefile can only have a one to one relationship with the second shapefile.

Here's an example. Let's say in shapefile 1 that I have 10 GPS points with names and other attributes that are spaced out between a square of Well Pads with many attributes in Shapefile 2. The Well pad on the upper left corner we'll call Pad 1. The upper right corner is Pad 2, the lower right corner is Pad 3 and the lower left is Pad 4 (Basically a square for this example with points on its corners). Let's say if you measured the distance of GPS points 1, 2 and 9 and found they were closest to Pad 3. Now you find that GPS points 4, 6 and 8 were closest to Pad 2. GPS point 5 and 7 are closest to Pad 1. Finally GPS points 3 and 10 are closest to Pad 4. The output I'd like to achieve would be as follows:

Attributes of GPS Point 1 + Attributes of Pad 3
Attributes of GPS Point 2 + Attributes of Pad 3
Attributes of GPS Point 3 + Attributes of Pad 4
Attributes of GPS Point 4 + Attributes of Pad 2
Attributes of GPS Point 5 + Attributes of Pad 1
Attributes of GPS Point 6 + Attributes of Pad 2
Attributes of GPS Point 7 + Attributes of Pad 1
Attributes of GPS Point 8 + Attributes of Pad 2
Attributes of GPS Point 9 + Attributes of Pad 3
Attributes of GPS Point 10 + Attributes of Pad 4

Remember, GPS point 10 will ignore proximity to any Pad besides Pad 4 because it is closest to it.

I've also attached a JPEG that shows what I'm talking about in the example above.

So ... Is this unrealistic to hope that something that can do this already exists. My only issue is if code is posted I'm not a person who knows coding unfortunately.

Thanks for your time everyone!!!
Tony

Attachments

Outcomes