Beispiel #1
0
 public string ToString()
 {
     return("LandID = " + LandId + "\n" +
            "LatitudeIndex = " + LatitudeIndex.ToString() + "\n" +
            "LongitudeIndex = " + LongitudeIndex.ToString() + "\n" +
            "Latitude = " + Latitude.ToString() + "\n" +
            "Longitude = " + Longitude.ToString() + "\n" +
            "OffsetFromCenter = " + OffsetFromCenter.ToString());
 }
Beispiel #2
0
    public void Init(double lat, double lon)
    {
        LatitudeIndex  = GetLatitudeIndex(lat);
        LongitudeIndex = GetLongitudeIndex(lon);

        LandId    = LatitudeIndex.ToString() + "H" + LongitudeIndex.ToString();
        Latitude  = LatitudeIndex / LandConsts.landsInDegree - LandConsts.maxLatitude;
        Longitude = LongitudeIndex / LandConsts.landsInDegree - LandConsts.maxLongitude;

        offsetFromCenter = GPSEncoder.GPSToUCS(new Vector2((float)lat, (float)lon)) -
                           GPSEncoder.GPSToUCS(new Vector2((float)Latitude, (float)Longitude));
    }