示例#1
0
		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;
		}
示例#2
0
        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));
     }
 }
示例#4
0
 public QualitySortPair(PositionAssociation assoc, double fitQuality)
 {
     this.assoc      = assoc;
     this.fitQuality = fitQuality;
 }
示例#5
0
			public QualitySortPair(PositionAssociation assoc, double fitQuality)
			{
				this.assoc = assoc;
				this.fitQuality = fitQuality;
			}