Point
A Point in Salesforce is a single geographic location stored as a latitude and longitude pair.
Definition
A Point in Salesforce is a single geographic location stored as a latitude and longitude pair. It pins one spot on the Earth, such as a customer address, a service appointment, or a sales rep's current position. On the platform this point lives inside a Geolocation field, and the Apex runtime models the same idea with the System.Location class.
Points are the raw material for every location-aware feature. Salesforce Maps plots them as markers, the DISTANCE formula function measures the space between two of them, and Field Service uses them to route mobile workers. A point only becomes useful once an address has been geocoded, which is the step that turns a street address into those two coordinates.
How a point is stored, queried, and put to work
The Geolocation field that holds a point
On a record, a point is stored in a Geolocation field. This is a compound field, which means it bundles two related values under one field name. A custom geolocation field called myLocation__c exposes two subfields, myLocation__latitude__s and myLocation__longitude__s, where the __s suffix marks each constituent value. You can read the whole field as a single Location object through the SOAP and REST APIs, or read latitude and longitude separately. Salesforce validates the numbers you store. Latitude must sit between -90 and +90 degrees, and longitude must sit between -180 and +180 degrees. The platform also refuses a half-filled point: either both subfields hold valid numbers, or both are null. You cannot save a latitude without its matching longitude. One practical cost to plan for is the field limit. Each geolocation field counts as three custom fields against an object's allocation, one for latitude, one for longitude, and one for internal use, so a point is not as cheap as a single text field.
Turning an address into coordinates
A point rarely starts life as raw numbers. It usually starts as a street address that someone typed into Account, Contact, or Lead. Geocoding is the conversion step that reads that address and returns a latitude and longitude. Salesforce ships standard geocode fields on the address-bearing standard objects, and Geocode Data Integration Rules fill them automatically. When the rules are active, Salesforce sends the physical address to a geocoding service, gets back coordinates, and writes them to the standard geocode fields. If the address later changes, the latitude and longitude refresh to match. That keeps your points honest over time without manual cleanup. The accuracy of a returned point varies, and each geocode result carries an accuracy rating that tells you whether the match landed on the exact address, the street, the postal code, or just the city. Knowing that rating matters, because a rooftop-accurate point and a city-centroid point can sit miles apart while both look like valid coordinates on a record.
Measuring distance between two points
Once two records each hold a point, you often want the distance between them. Salesforce gives you the DISTANCE function for exactly that. In a formula field you write DISTANCE(mylocation1, mylocation2, 'unit'), where unit is either 'mi' for miles or 'km' for kilometers. The function returns the straight-line distance, calculated with the haversine formula that mapping tools use. You are not limited to two stored points. The GEOLOCATION function builds a point on the fly from a fixed latitude and longitude, so you can measure how far each record sits from a single anchor, like a warehouse or an event venue. The same DISTANCE and GEOLOCATION pair works inside SOQL and SOSL, which lets you filter and sort query results by proximity. A query can return the ten nearest stores to a given coordinate, ordered closest first. That single capability powers most "find what is near me" experiences built on the platform.
Working with points in Apex
Apex models a point through the System.Location class. You create one with Location.newInstance(latitude, longitude), and you read its parts with getLatitude() and getLongitude(). The related System.Address class represents a postal address and can expose its own Location, so code can move between an address and its coordinates. The most useful method for points is getDistance. Calling location1.getDistance(location2, 'km') returns the distance between two Location values directly in code, without a formula field or a query. This is handy in triggers, batch jobs, and services that need proximity logic at scale. Because the calculation runs in Apex, you can feed it points that you build in memory rather than ones stored on records. A common pattern is to accept a user's current coordinates from a mobile app, wrap them in a Location, and compare against a list of account points to decide which site a field rep should visit next. The class keeps the math consistent with the formula and SOQL versions.
Plotting points in Salesforce Maps
Salesforce Maps is where points become something a person can see. Maps reads geocoded records and draws each point as a marker on an interactive map. You group those markers into marker layers, so all open cases or all accounts in a segment appear together with a shared color and icon. A layer is really just a saved set of points pulled from a base object and a filter. Maps adds context around the raw points. Shape layers overlay boundaries such as countries, states, counties, census tracts, and postal codes, which lets a rep see which territory a cluster of points falls inside. The search bar can plot a point from three sources at once: a point of interest like a typed address, a record already sitting in a marker layer, and any geocoded Salesforce record tied to a configured base object. For a record to appear from that last source, it must be geocoded and its object must be set up as a Maps base object. Without coordinates, a record stays invisible to the map.
Why accurate points matter for field operations
The business value of a point shows up most clearly in the field. Field Service and Salesforce Maps use points to build routes, so a technician or sales rep visits stops in an efficient order instead of crisscrossing a region. A route is only as good as the points behind it. If an account sits at a city-centroid point rather than its real address, the route sends someone to the wrong block. That is why the accuracy rating and the geocode rules earn their keep. Teams that care about routing usually audit low-accuracy points and re-geocode or correct the address before trusting a plan. Points also feed reporting and analytics. CRM Analytics can render coordinates on a map chart, turning a column of latitude and longitude into a spatial view of where revenue or open work concentrates. The throughline is simple: a point is a small piece of data, but the quality of every map, route, and proximity calculation downstream depends on getting those two numbers right.
Add a Geolocation field to store a point
Most points live in a Geolocation field. Here is how an admin adds one to an object so records can store coordinates and feed maps, formulas, and Apex. You create the field in Setup with the Object Manager.
- Open the object in Object Manager
In Setup, go to Object Manager and pick the object that needs a point, such as Account or a custom object. Open its Fields and Relationships area and click New.
- Choose the Geolocation field type
Select Geolocation from the data type list. This is the type that stores a latitude and longitude pair as one compound field rather than two separate number fields.
- Set label, name, and decimal places
Enter a field label and let the API name populate. Choose the number of decimal places for the coordinates, since more decimals give a more precise point but each one widens the stored value.
- Set field-level security and add to layouts
Pick which profiles can see and edit the point, then add the field to the page layouts where users enter or review location data. Save to finish.
Controls coordinate precision; higher values pinpoint a tighter spot but use a larger stored number.
Decides which profiles can view or edit the latitude and longitude on records.
Determines where the point appears for data entry, since a hidden field cannot be populated by users.
- A geolocation field counts as three custom fields against the object's field limit, not one.
- You cannot save only a latitude or only a longitude; both subfields must be filled or both left null.
- A record with no coordinates will not plot in Salesforce Maps, so pair the field with geocoding.
Prefer this walkthrough as its own page? How to Point in Salesforce, step by step
Trust & references
Cross-checked against the following references.
- Geolocation Compound Field, Object ReferenceSalesforce
- Location-Based SOQL QueriesSalesforce
Straight from the source - Salesforce's reference material on Point.
- Geolocation Custom FieldSalesforce
- Location Class, Apex Reference GuideSalesforce
Hands-on resources to go deeper on Point.
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. What two coordinate values typically define a Point in Salesforce Maps?
Q2. How is a Point on an Account record in Salesforce Maps usually produced from the stored address?
Q3. Which Salesforce capability relies on stored Points to optimize technician travel?
Discussion
Loading discussion…