# How can I compare two point shapefiles that contain lat/longs and compute distance?

Greetings everyone, I have 2 sets of point shapefiles in ArcGIS (group A and B), each set has around 1000 entries that contain lat/long. What I want to do is compare Group A against Group B and figure out for every point in Group A what point in Group B is the closest and what that distance is. What would be the easiest way to do this in arcgis?

-

You could run a Spatial Join between the two layers. In ArcMap TOC, right click the layer and select Joins and Relates>Join. On the top drop down select "Join data from another layer based on spatial location." Check the radio button that says, "Each point will be given all the attribute...etc". This will give you a distance value.

You can also use the Near tool.

-
This seems to work but it is giving weird numbers, I am guessing they are decimal degrees. For example one distance is .185239. How can I change the unit of measurement to miles? –  Furlong Jun 6 '11 at 17:04
I just read that you can convert decimal degrees to miles by taking 69.11 times the cosine of the decimal degree. I did a field calculation on the distance field using 69.11*Cos ( [Distance] ). Would this be correct? –  Furlong Jun 6 '11 at 17:19
@Furlong, either update the data frame>Properties>General tab and set Display to something like feet or you may want to define or re-project your two layers to a projected coordinate system before using the spatial join option. I believe when measuring between points your data should be in a projected coordinate system, not a geographic one. –  artwork21 Jun 6 '11 at 17:20
@Furlong If Spatial Joins operate on the projection of the Data Frame, you can probably get away with just changing the projection of that. –  Nathanus Jun 6 '11 at 17:27
@Nathanus thank you for your advice, what should I change the projection to? My data covers the continental US, including Alaska and Hawaii. –  Furlong Jun 6 '11 at 17:50

If you have ArcInfo make use of the Near tool to generate exactly what you're looking for. You can set it to only find the closest feature in Group B from Group A, and it will create a table containing the distances.

-
Unfortunately I do not have ArcInfo :( –  Furlong Jun 6 '11 at 17:12
Better start selling lemonade! .... lots. –  Nathanus Jun 6 '11 at 17:20