Example #1
0
 public static string GetSectorImagePath(ISector sector, string root = null)
 {
     if (root == null)
     {
         root = GetRenderRoot();
     }
     if (sector is MercatorSector)
     {
         var parent  = sector.GetChildrenAtLevel(sector.Zoom + 1)[0].GetAllParents().Where(x => x.Zoom == 10);
         var parent5 = sector.GetChildrenAtLevel(sector.Zoom + 1)[0].GetAllParents().Where(x => x.Zoom == 5);
         if (parent.Count() != 0)
         {
             return(Path.Combine(root, parent5.Single().ToString(), parent.Single().ToString() + ".PNG"));
         }
         if (parent5.Count() != 0)
         {
             return(Path.Combine(root, parent5.Single().ToString(), sector.ToString() + ".PNG"));
         }
         return(Path.Combine(root, sector.ToString() + ".PNG"));
     }
     if (sector is CubeSector)
     {
         var parent  = sector.GetChildrenAtLevel(sector.Zoom + 1)[0].GetAllParents().Where(x => x.Zoom == 8);
         var parent4 = sector.GetChildrenAtLevel(sector.Zoom + 1)[0].GetAllParents().Where(x => x.Zoom == 4);
         if (parent.Count() != 0)
         {
             return(Path.Combine(root, ((CubeSector)sector).sectorFace.GetFaceAcronym() + "Face", parent4.Single().ToString(), parent.Single().ToString() + ".PNG"));
         }
         if (parent4.Count() != 0)
         {
             return(Path.Combine(root, ((CubeSector)sector).sectorFace.GetFaceAcronym() + "Face", parent4.Single().ToString(), sector.ToString() + ".PNG"));
         }
         return(Path.Combine(root, ((CubeSector)sector).sectorFace.GetFaceAcronym() + "Face", sector.ToString() + ".PNG"));
     }
     throw new NotImplementedException();
 }
Example #2
0
 public override string ToString()
 {
     return("BigTrees, " + sector.ToString());
 }
 public override string ToString()
 {
     return("HotDay, " + sector.ToString());
 }
 public override string ToString()
 {
     return(sector.ToString());
 }
Example #5
0
 public override string ToString()
 {
     return("Dia lluvioso, " + sector.ToString());
 }
Example #6
0
		public override string ToString()
		{
			return "Gente asustada, " + sector.ToString();
		}
Example #7
0
 public override string ToString()
 {
     return("Mucho viento, " + sector.ToString());
 }
Example #8
0
 public override string ToString()
 {
     return("ScaredPeople, " + sector.ToString());
 }
Example #9
0
 public override string ToString()
 {
     return("Arboles grandes, " + sector.ToString());
 }
 public override string ToString()
 {
     return("DryGrass, " + sector.ToString());
 }
Example #11
0
        internal static void ConvertHGTZIPsToHGTZIP(ISector sector, string rootFolder, bool overwrite)
        {
            string outputPath = Path.Combine(rootFolder, sector.GetAllParents().Where(x => x.Zoom == 4).Single().ToString(), sector.ToString() + ".HGT.ZIP");

            if (!overwrite && File.Exists(outputPath))
            {
                return;
            }
            int[,] shorts = ConvertHGTZIPsToShorts(sector);
            byte[] outputBytes = new byte[REZ * REZ * 2];
            for (int x = 0; x < REZ; x++)
            {
                for (int y = 0; y < REZ; y++)
                {
                    outputBytes[(REZ * y + x) * 2]     = (byte)(shorts[x, y] / 256);
                    outputBytes[(REZ * y + x) * 2 + 1] = (byte)(shorts[x, y] % 256);
                }
            }
            string directoryName = Path.GetDirectoryName(outputPath);

            if (!Directory.Exists(directoryName))
            {
                Directory.CreateDirectory(directoryName);
            }
            Compression.ZipToFile(outputPath, outputBytes);
        }
Example #12
0
 public override string ToString()
 {
     return("Pasto seco, " + sector.ToString());
 }
 public override string ToString()
 {
     return("RainingDay, " + sector.ToString());
 }
Example #14
0
 public override string ToString()
 {
     return("Mucho calor, " + sector.ToString());
 }