public RegistrationDefinition getWarpedRegistration() { IPointTransformer pointTransformer = this.getSourceToDestLatLonTransformer(); List<PositionAssociation> associationList = this.registration.GetAssociationList(); List<IImageTransformer.QualitySortPair> list = new List<IImageTransformer.QualitySortPair>(); for (int i = 0; i < associationList.Count; i++) { PositionAssociation positionAssociation = associationList[i]; bool invertError; LatLon p = pointTransformer.getTransformedPoint(positionAssociation.sourcePosition.pinPosition.latlon, out invertError); PositionAssociation positionAssociation2 = new PositionAssociation(positionAssociation.associationName, positionAssociation.imagePosition.pinPosition, new LatLonZoom(p.lat, p.lon, positionAssociation.sourcePosition.pinPosition.zoom), positionAssociation.globalPosition.pinPosition, new DirtyEvent()); positionAssociation2.sourcePosition.invertError = invertError; positionAssociation2.sourcePosition.SetErrorPosition(DisplayablePosition.ErrorMarker.AsContributor, positionAssociation.globalPosition.pinPosition.latlon); positionAssociation2.pinId = positionAssociation.pinId; double num = LatLon.DistanceInMeters(p, positionAssociation.globalPosition.pinPosition.latlon); positionAssociation2.qualityMessage = LatLon.PrettyDistance(num); list.Add(new IImageTransformer.QualitySortPair(positionAssociation2, num)); } list.Sort(); RegistrationDefinition registrationDefinition = new RegistrationDefinition(new DirtyEvent()); registrationDefinition.warpStyle = this.registration.warpStyle; foreach (IImageTransformer.QualitySortPair current in list) { registrationDefinition.AddAssociation(current.assoc); } registrationDefinition.isLocked = true; return registrationDefinition; }
public RegistrationDefinition getWarpedRegistration() { IPointTransformer pointTransformer = this.getSourceToDestLatLonTransformer(); List <PositionAssociation> associationList = this.registration.GetAssociationList(); List <IImageTransformer.QualitySortPair> list = new List <IImageTransformer.QualitySortPair>(); for (int i = 0; i < associationList.Count; i++) { PositionAssociation positionAssociation = associationList[i]; bool invertError; LatLon p = pointTransformer.getTransformedPoint(positionAssociation.sourcePosition.pinPosition.latlon, out invertError); PositionAssociation positionAssociation2 = new PositionAssociation(positionAssociation.associationName, positionAssociation.imagePosition.pinPosition, new LatLonZoom(p.lat, p.lon, positionAssociation.sourcePosition.pinPosition.zoom), positionAssociation.globalPosition.pinPosition, new DirtyEvent()); positionAssociation2.sourcePosition.invertError = invertError; positionAssociation2.sourcePosition.SetErrorPosition(DisplayablePosition.ErrorMarker.AsContributor, positionAssociation.globalPosition.pinPosition.latlon); positionAssociation2.pinId = positionAssociation.pinId; double num = LatLon.DistanceInMeters(p, positionAssociation.globalPosition.pinPosition.latlon); positionAssociation2.qualityMessage = LatLon.PrettyDistance(num); list.Add(new IImageTransformer.QualitySortPair(positionAssociation2, num)); } list.Sort(); RegistrationDefinition registrationDefinition = new RegistrationDefinition(new DirtyEvent()); registrationDefinition.warpStyle = this.registration.warpStyle; foreach (IImageTransformer.QualitySortPair current in list) { registrationDefinition.AddAssociation(current.assoc); } registrationDefinition.isLocked = true; return(registrationDefinition); }
public async Task ReportPositionAssociation(PositionAssociation association) { try { await _associationPublisher.PublishAsync(association); } catch (Exception ex) { _logger.LogError(ex, "Cannot publish PositionAssociation: {jsonText}", JsonConvert.SerializeObject(association)); } }
public QualitySortPair(PositionAssociation assoc, double fitQuality) { this.assoc = assoc; this.fitQuality = fitQuality; }