- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can anyone share their experience in calculating distance between two nz addresses?
I had a quick browse and have no clue how to set up/access API.
Sad that SASHELP.ZIPCODE has no such info for New Zealand.
Would be great to get the practical idea on how to actually using SAS to calculate the distance/travel time required between two address vars.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you need travel distance it keeps a bit more complicated, you'll need to send your data to a service to get the distance, such as Google Maps, OpenStreetMaps, ESRI. Then it will return the distance.
This unfortunately isn't a simple straightforward few lines of code that anyone can provide, especially since Google has now restricted their API and you need a full developer set up to get that going which is a major pain. It also means you are sending your data to an external data provider which could violate privacy regulations. If you want to go down this route, search lexjansen.com for example code, but most may be out of date due to the recent changes.
https://www.lexjansen.com/search/searchresults.php?q=distance%20between%20locations
If you need straight line distances that gets a lot easier. You can use PROC GEOCODE to get the latitude/longitude and then use GEODIST() function to get the distance. You could probably do that to get an upper bound on your distances as a check anyways.
@Suzy_Cat wrote:
Hello,
Can anyone share their experience in calculating distance between two nz addresses?
I had a quick browse and have no clue how to set up/access API.
Sad that SASHELP.ZIPCODE has no such info for New Zealand.
Would be great to get the practical idea on how to actually using SAS to calculate the distance/travel time required between two address vars.
Thanks