diff --git a/OSM_Regions/Utils/RegionUtils.cs b/OSM_Regions/Utils/RegionUtils.cs index a045754..a075ed4 100644 --- a/OSM_Regions/Utils/RegionUtils.cs +++ b/OSM_Regions/Utils/RegionUtils.cs @@ -6,8 +6,8 @@ public static class RegionUtils { public static long GetRegionIdFromCoordinates(float lat, float lon, float regionSize) { - string latStr = $"{Math.Floor(lat / regionSize):000000}".Replace(".","").Replace(",", ""); - string lonStr = $"{Math.Floor(lon / regionSize):000000}".Replace(".","").Replace(",", ""); + string latStr = $"{Math.Floor((90 + lat) / regionSize):000000}"; + string lonStr = $"{Math.Floor((180 + lon) / regionSize):000000}"; return long.Parse(string.Concat(latStr, lonStr)); }