## compute distances between latitude/longitude points

Solved
Regular Contributor
Posts: 207

# compute distances between latitude/longitude points

I have the following fields:
equipment: name of equipment
Lat1: latitude for equipment
Long1: longitude for equipment
location: name of location
Lat2: latitude for location
Long2: longitude for location

There are approximately 500K pieces of equipment and 3K locations.
Can anyone recommend a strategy for finding all the pieces of equipment within 0.5 miles for each of the locations in the dataset?
If needed I can restrict the number of pieces of equipment that are within 0.5 miles for each location (e.g. only find a maximum of 5 pieces of equipment for each location).

Accepted Solutions
Solution
‎07-27-2017 08:19 PM
Regular Contributor
Posts: 207

## Re: compute distances between latitude/longitude points

The strategy I'm currently using is to divide the datasets into smaller parts and then generate Cartesian Products with PROC SQL. After merging I use geodist to calculate the distances.

All Replies
PROC Star
Posts: 1,283

## Re: compute distances between latitude/longitude points

Use GEODIST function. Please provide sample data if you want a code answer.

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003113162.htm

Solution
‎07-27-2017 08:19 PM
Regular Contributor
Posts: 207

## Re: compute distances between latitude/longitude points

The strategy I'm currently using is to divide the datasets into smaller parts and then generate Cartesian Products with PROC SQL. After merging I use geodist to calculate the distances.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
• 2 replies
• 131 views
• 0 likes
• 2 in conversation