Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I use GeoCoder as a Distance Calculator?

calculator distance geocoder
0
Posted

How do I use GeoCoder as a Distance Calculator?

0

GeoCoder can be used to determine the distance between two points. For this functionality, you only need the ZIP and Plus4 from the two points. That can be obtained using Address Object. Once you have that, run GeoCoder on those two locations and extract the latitude and longitude. Then, simply pass those two sets of latitude/longitudes into the ComputeDistance() method, and a distance of miles will be returned to you. geoObj.GeoCoder(Location1ZIP, Location1Plus4) Lat1 = geoObj.latitude Long1 = geoObj.longitude geoObj. GeoCoder(Location2ZIP, Location2Plus4) Lat2 = geoObj.latitude Long2 = geoObj.longitude Miles = geoObj.ComputeDistance(Lat1,Long1,Lat2,Long2) This can be used for applications like a Dealer Locator where you have a point of origin and several dealer locations. You would compute the distance from the origin to each dealer location and pick the one with the smallest distance.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123