SELECT *
FROM (
SELECT
a.TestTime AS test_date,
client.Geo.City AS city,
client.Geo.CountryName AS country,
client.Geo.Subdivision1Name AS region,
client.Geo.Latitude AS latitude,
client.Geo.Longitude AS longitude,
client.Network.ASName AS ISP_name,
-- Fix: upload vs download naming
a.MeanThroughputMbps AS upload_mbps,
a.Direction AS direction,
a.MinRTT AS latency_ms,
-- Grid creation
CAST(ROUND(client.Geo.Latitude, 3) AS STRING) AS lat_grid,
CAST(ROUND(client.Geo.Longitude, 3) AS STRING) AS lon_grid,
-- Keep latest record per grid
ROW_NUMBER() OVER (
PARTITION BY
CAST(ROUND(client.Geo.Latitude, 3) AS STRING),
CAST(ROUND(client.Geo.Longitude, 3) AS STRING)
ORDER BY a.TestTime DESC
) AS rn
FROM
`measurement-lab.ndt.unified_uploads`
WHERE
client.Geo.CountryCode = "BH"
AND date BETWEEN "2020-01-01" AND "2026-12-31"
AND client.Geo.Latitude IS NOT NULL
AND client.Geo.Longitude IS NOT NULL
AND client.Geo.AccuracyRadiusKm <= 5
)
WHERE rn = 1;
However, I am consistently encountering the following issue:
- Many records share identical latitude/longitude values
- In some cases, all measurements within a city appear at the same coordinates
- This results in very limited spatial distribution when visualizing the data
This is problematic for my use case, as my project requires:
- Mapping speed measurements to specific areas/blocks within Bahrain
- Comparing performance against nearby cellular tower locations
- Identifying localized coverage gaps and infrastructure issues
At the moment, the data appears too spatially aggregated to support this level of analysis.
My questions:
- Are the client.Geo.Latitude and client.Geo.Longitude fields intentionally coarsened or anonymized (e.g., city-level or grid-level resolution)?
- Is there any dataset, field, or method within M-Lab that provides higher-resolution geolocation for NDT tests?
- Are there recommended approaches for performing fine-grained spatial analysis using M-Lab data (e.g., grid aggregation, alternative datasets, or APIs)?
- Would applying filters such as client.Geo.AccuracyRadiusKm meaningfully improve spatial precision?