using System.Collections;
using System.Collections.Generic;
public static void Main()
double latitude = 34.05072;
double longitude = -118.25477;
List<City> cities = new List<City>();
Latitude = 34.0673431844741,
Longitude = -118.276097656207
var nearestCity = cities.GroupBy(x => Math.Pow((latitude - x.Latitude), 2) + Math.Pow((longitude - x.Longitude), 2))
Console.WriteLine(nearestCity.First().CityCode);
public string CityCode { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }