Using Spreadsheets: Get Location Information (Lat/Long)

PC*Miler Spreadsheets includes a number of functions that allow you to retrieve location information from the PC*Miler database.

Get a Latitude/Longitude from a Location

=CityToLatLong (CityStateOrZipcode)

CityToLatLong takes a PC*Miler location (city-state, postal code, SPLC, truck stop, PC*Miler custom name) and returns the latitude/longitude of a point central to the location in degrees, minutes, seconds format (dddmmssN,dddmmssW). CityToLatLong returns *-1 * if the PC*Miler place name you entered is invalid.

Uu01SrW3md2TmuFRHaOCyRkJorpI7qDk2A

Get a Place Name from a Latitude/Longitude

=LatLongToCity (LatLong)

LatLongToCity takes a latitude/longitude (degrees, minutes, seconds or decimal degrees format) and returns the miles from the PC*Miler place name at the closest end of the closest road segment. This may be either a city-state or a road intersection.

This function connects latitude/longitudes to the highway network as if you were routing to or from the latitude/longitude. LatLongToCity returns a *-1 * if the lat/long format is invalid or is more than 200 miles from a road in the PC*Miler highway network.

The CityToLatLong and LatLongToCity functions may be, but are not necessarily, reversible because not all PC*Miler place names are located at the end points of road segments.

8KQ6Rl7q FNbHHfdNnJlStMrOUrGawu0eA

Get a Latitude/Longitude from an Address

=AddressToLatLong (Address)

(In North America with the Streets add-on only) AddressToLatLong takes a street address and returns the latitude/longitude in degrees, minutes, seconds format (dddmmssN,dddmmssW). AddressToLatLong returns *-1 * if the place name you entered is invalid.

The function may be, but is not necessarily reversible. For a decimal format return, see the PCMSERVE.INI file.

TP6faiX3tmUJqQP0lq0hzEkcfyQsf2lfQQ

Get an Address from a Latitude/Longitude

=LatLongToAddress (LatLong)

(In North America with with the Streets add-on only)   LatLongToAddress takes a latitude/longitude (degrees, minutes, seconds or decimal degrees format) and returns the address. This function connects latitude/longitudes to the highway network as if you were routing to or from the latitude/longitude.

LatLongToAddress returns a *-1 * if the lat/long format is invalid or is more than 200 miles from a road in the streets highway network. The function may be, but is not necessarily reversible.

For roads that have both a street name and a route number, the route number will be returned in parentheses after the street name. For example:

=latlongtoaddress(addresstolatlong("Princeton, NJ; 245 Nassau Street")) returns

08540 Princeton, NJ, Mercer; 245 Nassau Street (NJ-27).

69rilLKdko090ZqSOyiYzmMy18g5n7T3fg