Пример #1
0
        public GPSCoordinate(enumLongitudeReference enumLongitudeDirection, int intLongitudeDegrees, double dblLongitudeMinutes, enumLatitudeReference enumLatitudeDirection, int intLatitudeDegrees, double dblLatitudeMinutes, Distance objAltitude, string strAltitudeReference)
        {
            _objAlt    = objAltitude;
            _strAltRef = strAltitudeReference;

            Fill(enumLongitudeDirection, intLongitudeDegrees, dblLongitudeMinutes, enumLatitudeDirection, intLatitudeDegrees, dblLatitudeMinutes);
        }
Пример #2
0
        public GPSCoordinate(enumLongitudeReference enumLongitudeDirection, int intLongitudeDegrees, double dblLongitudeMinutes, enumLatitudeReference enumLatitudeDirection, int intLatitudeDegrees, double dblLatitudeMinutes, Distance objAltitude, string strAltitudeReference)
        {
            _objAlt = objAltitude;
            _strAltRef = strAltitudeReference;

            Fill(enumLongitudeDirection, intLongitudeDegrees, dblLongitudeMinutes, enumLatitudeDirection, intLatitudeDegrees, dblLatitudeMinutes);
        }
Пример #3
0
        public void Fill(int intLongitudeDegrees, double dblLongitudeMinutes, int intLatitudeDegrees, double dblLatitudeMinutes)
        {
            //First I need to figure out and store the direction (N,S,E,W) of the Longitude and Latitude
            enumLongitudeReference enumLonRef = GetLongitudeReference(intLongitudeDegrees);
            enumLatitudeReference  enumLatRef = GetLatitudeReference(intLatitudeDegrees);

            //Now Fill
            Fill(enumLonRef, intLongitudeDegrees, dblLongitudeMinutes, enumLatRef, intLatitudeDegrees, dblLatitudeMinutes);
        }
Пример #4
0
 private double SetDirectionSign(double dblCoord, enumLongitudeReference enumLonRef)
 {
     if (enumLonRef == enumLongitudeReference.West)
     {
         return(-(Math.Abs(dblCoord)));
     }
     else
     {
         return(Math.Abs(dblCoord));
     }
 }
Пример #5
0
 private void Fill(enumLongitudeReference enumLonRef, int intLongitudeDegrees, int intLongitudeMinutes, double dblLongitudeSeconds, enumLatitudeReference enumLatRef, int intLatitudeDegrees, int intLatitudeMinutes, double dblLatitudeSeconds)
 {
     //First I need to get the Absolute value before doing any math
     intLongitudeDegrees = Math.Abs(intLongitudeDegrees);
     intLatitudeDegrees  = Math.Abs(intLatitudeDegrees);
     //Now I will build the numeric coordinate
     _dblLon = ((double)intLongitudeDegrees) + (((double)intLongitudeMinutes) / 60) + (dblLongitudeSeconds / 3600);
     _dblLat = ((double)intLatitudeDegrees) + (((double)intLatitudeMinutes) / 60) + (dblLatitudeSeconds / 3600);
     //Now I will restore the negative values where necessary
     _dblLon = SetDirectionSign(_dblLon, enumLonRef);
     _dblLat = SetDirectionSign(_dblLat, enumLatRef);
 }
Пример #6
0
 public GPSCoordinate(enumLongitudeReference enumLongitudeDirection, int intLongitudeDegrees, double dblLongitudeMinutes, enumLatitudeReference enumLatitudeDirection, int intLatitudeDegrees, double dblLatitudeMinutes)
 {
     Fill(enumLongitudeDirection, intLongitudeDegrees, dblLongitudeMinutes, enumLatitudeDirection, intLatitudeDegrees, dblLatitudeMinutes);
 }
Пример #7
0
 private double SetDirectionSign(double dblCoord, enumLongitudeReference enumLonRef)
 {
     if(enumLonRef == enumLongitudeReference.West)
         return -(Math.Abs(dblCoord));
     else
         return Math.Abs(dblCoord);
 }
Пример #8
0
 private void Fill(enumLongitudeReference enumLonRef, int intLongitudeDegrees, int intLongitudeMinutes, double dblLongitudeSeconds, enumLatitudeReference enumLatRef, int intLatitudeDegrees, int intLatitudeMinutes, double dblLatitudeSeconds)
 {
     //First I need to get the Absolute value before doing any math
     intLongitudeDegrees = Math.Abs(intLongitudeDegrees);
     intLatitudeDegrees = Math.Abs(intLatitudeDegrees);
     //Now I will build the numeric coordinate
     _dblLon = ((double) intLongitudeDegrees) + (((double) intLongitudeMinutes) / 60) + (dblLongitudeSeconds / 3600);
     _dblLat = ((double) intLatitudeDegrees) + (((double) intLatitudeMinutes) / 60) + (dblLatitudeSeconds / 3600);
     //Now I will restore the negative values where necessary
     _dblLon = SetDirectionSign(_dblLon,enumLonRef);
     _dblLat = SetDirectionSign(_dblLat,enumLatRef);
 }
Пример #9
0
 public GPSCoordinate(enumLongitudeReference enumLongitudeDirection, int intLongitudeDegrees, double dblLongitudeMinutes, enumLatitudeReference enumLatitudeDirection, int intLatitudeDegrees, double dblLatitudeMinutes)
 {
     Fill(enumLongitudeDirection, intLongitudeDegrees, dblLongitudeMinutes, enumLatitudeDirection, intLatitudeDegrees, dblLatitudeMinutes);
 }