private (bool, StatAreaLocation) NearestBoundingBox(LatLong pt, OrderedFeatures locations) { foreach (var feat in locations.BoundariesContainingPoint(pt)) { // allocate to the first bounding box it finds var areaName = feat.Parameters.Name; var statisticalArea = long.Parse(feat.Parameters.Id); return(true, new StatAreaLocation(statisticalArea, areaName)); } return(false, StatAreaLocation.Null()); }
private (bool, StatAreaLocation) InFeatureSet(LatLong pt, OrderedFeatures locations) { foreach (var feat in locations.BoundariesContainingPoint(pt)) { foreach (var poly in feat.Locations) { if (poly.PointInPolygon(pt)) { // allocate to the first region it finds var areaName = feat.Parameters.Name; var statisticalArea = long.Parse(feat.Parameters.Id); return(true, new StatAreaLocation(statisticalArea, areaName)); } } } return(false, StatAreaLocation.Null()); }