private ConstituencyArea generateConstituencyArea(decimal[][][] rings) { ConstituencyArea constituencyArea = new ConstituencyArea(); constituencyArea.Id = GenerateNewId(); constituencyArea.ConstituencyAreaExtent = generateConstituencyAreaExtent(rings); return(constituencyArea); }
public override BaseResource[] SynchronizeIds(BaseResource[] source, Uri subjectUri, BaseResource[] target) { OnsConstituencyGroup constituency = source.OfType <OnsConstituencyGroup>().SingleOrDefault(); constituency.Id = subjectUri; ConstituencyArea constituencyArea = target.OfType <ConstituencyArea>().SingleOrDefault(); if ((constituencyArea != null) && (constituency.ConstituencyGroupHasConstituencyArea != null)) { constituency.ConstituencyGroupHasConstituencyArea.Id = constituencyArea.Id; } return(new BaseResource[] { constituency }); }
private ConstituencyArea generateConstituencyArea(RDFDescription description) { ConstituencyArea constituencyArea = new ConstituencyArea(); constituencyArea.Id = GenerateNewId(); if (description.lat != null) { constituencyArea.ConstituencyAreaLatitude = description.lat.Value; } if (description.@long != null) { constituencyArea.ConstituencyAreaLongitude = [email protected]; } if ((description.asGML != null) && (string.IsNullOrWhiteSpace(description.asGML.Value) == false)) { string xmlPolygon = description.asGML.Value.ToString().Replace("gml:", string.Empty); XElement[] polygons = XDocument.Parse(xmlPolygon) .Descendants("coordinates") .ToArray(); List <string> areas = generatePolygonArea(polygons); constituencyArea.ConstituencyAreaExtent = areas; } return(constituencyArea); }