> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Geographical ranking precision

> How Algolia stores, ranks, and displays geographical coordinates.

export const Records = () => <Tooltip tip="A record is a searchable object in an Algolia index. Each record consists of named attributes." cta="Algolia records" href="/doc/guides/sending-and-managing-data/prepare-your-data#algolia-records">
    records
  </Tooltip>;

## How Algolia handles coordinate precision

Algolia uses three distinct precisions when working with geolocations:

* **Indexed precision**: the `lat`/`lng` values you sent in `_geoloc`. Echoed back unchanged in each hit.
* **Internal precision**: the values Algolia uses for geo-search. Stored at roughly 10 m resolution (4 decimal places).
* **Display precision**: how the engine prints internal values in `_rankingInfo.matchedGeoLocation`.

The original `_geoloc` in your hits is preserved at the precision you indexed. The ranking and `matchedGeoLocation` fields use floored values.

## Geo-search precision

Algolia searches geolocations with a default of about 10 m of resolution. Coordinates finer than that are floored to fit the grid.

Search therefore by default treats two records within roughly 10 m of each other as the same point. You can widen this grid with [`aroundPrecision`](/doc/api-reference/api-parameters/aroundPrecision), but you can't go below the 10 m floor.

<Note>
  The original `_geoloc` you indexed is returned unchanged in each hit. Only the search and `matchedGeoLocation` use approximate values.
</Note>

## What `matchedGeoLocation` returns

When you request [`getRankingInfo=true`](/doc/api-reference/api-parameters/getRankingInfo), each hit includes `_rankingInfo.matchedGeoLocation` with the `lat`, `lng`, and `distance` of the point that matched your geo-query.

These coordinates are Algolia's floored internal value, not your original `_geoloc`.

<Note>
  To read the coordinates exactly as you sent them, use the `_geoloc` field on the hit.
</Note>

## Group results with `aroundPrecision`

Precision (using the search query parameter `aroundPrecision`) is used to group results that have more or less the same distance from a central point.

Algolia's default precision is 10 meters.
However, a 10-meter difference might not be significant: intervals of 200 meters may make more sense.
By creating 200-meter intervals, you rank all <Records /> that fall within that interval the same.
They're ranked higher than all records between 200 and 400 meters.

If you set `aroundPrecision` to 200, you'll have the following search results:

* Group of results in the 0-200 meters range will be the best ranked (ranked equally)
* Group of results in the 200-400 meters range will be ranked a bit lower
* Group of results in the 400-600 meters range will be ranked even lower

Another example is when users are looking for nearby recommended restaurants.
The goal is to display results that are a good mix of nearby and highly rated restaurants.

If there are two restaurants within 200 meters of a user's location:

* Restaurant A with a 5 star rating and distance of 150 meters (farther)
* Restaurant B with a 3 star rating and distance of 100 meters (closer)

If you're only sorting by geographical distance, restaurant B will be ranked higher since it's closer to the user.

But by setting `aroundPrecision` to 200, restaurant A and B will be ranked equally: the distances of 150 and 100 will be considered equal to 0 (and distances of 250 and 210 will be equal to 200, and so on).

Going further, since the results of A and B are tied under the `Geo` criterion, the search engine will examine the other criteria in the ranking formula to further sort the results. Restaurant A will therefore be ranked higher in the result due to its higher rating.
