orloff,
<script>
const item = [
{id: 1, name: 'test', address: {lat: 5}},
{id: 2, name: 'test', address: {lat: 5}},
{id: 3, name: 'test', address: {lat: 7}},
{id: 4, name: 'test', address: {lat: 7}},
{id: 5, name: 'test', address: {lat: 7}},
{id: 6, name: 'test', address: {lat: 9}},
{id: 7, name: 'test', address: {lat: 1}},
{id: 8, name: 'test', address: {lat: 3}},
{id: 9, name: 'test', address: {lat: 8}},
{id: 10, name: 'test', address: {lat: 9}},
]
let ratioOffset = {};
function find() {
item.forEach((el, i) => { // Перебор всех точек
let lat = el.address.lat;
el.ratioOffset = ratioOffset[lat] = (ratioOffset[lat]|| 0) +1
});
console.log(item);
}
find();
document.write(`<pre>${JSON.stringify(item, "", 1)}</pre>`)
</script>