- latitude
- longitude
Geolocation fields are provided on many standard objects, such as Account, Contact, Quote, and User, as part of their address field or fields. Geolocation fields can also be added as custom fields to standard or custom objects.
Retrieving Compound Geolocation Fields
SELECT location__latitude__s, location__longitude__s FROM Warehouse__c
Returned Geolocation Data Types
A compound geolocation field value is returned as the structured data type Location. Code that works with compound geolocation fields must reference the individual components of the returned value. See the sample code in Address Compound Fields.
In API versions earlier than 30.0, SOAP calls return compound geolocation field values as strings, instead of as a structured data type, for backward compatibility. If you plan to display your latitude and longitude values or pass them to a service that expects strings, use the values that are returned. If you plan to use the values in mathematical calculations or pass them to a map service that expects numbers, cast the results to numbers.
API location: [latitudeValue longitudeValue]
API location: \[([-+]?\d{1,2}([.]\d+)?) ([-+]?\d{1,3}([.]\d+)?)]