DATA Step, Macro, Functions and more

compute distances between latitude/longitude points

Accepted Solution Solved
Reply
Regular Contributor
Posts: 196
Accepted Solution

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
4 weeks ago
Regular Contributor
Posts: 196

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.

View solution in original post


All Replies
PROC Star
Posts: 552

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
4 weeks ago
Regular Contributor
Posts: 196

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
  • 75 views
  • 0 likes
  • 2 in conversation