//---------------------------------------------------------------------
        /// <summary>
        /// Loads DEM data depending on the cell size and the avaliable data.
        /// </summary>
        /// <param name="p">
        /// The waypoint that must be included in the DEM.
        /// </param>
        /// <param name="cellSize">
        /// The preferred cell size.
        /// </param>
        /// <param name="demList">
        /// The DEM List where loaded DEMs will added.
        /// </param>
        /// <returns>
        /// The DEM List with the new DEMs included.
        /// </returns>
        //---------------------------------------------------------------------
        public static Dem createDem(Point p, Dem.Precision precision,
                                    List <Dem> demList)
        {
            DemType demType = selectDemGenerator(precision);
            Dem     dem;
            string  path = buildPath(p, demType);

            if (existsPath(demType, path, demList))
            {
                if (demType == DemType.Icc)
                {
                    dem = new Icc(path);
                }
                else if (demType == DemType.Srtm3)
                {
                    dem = new Srtm3(path);
                }
                else
                {
                    dem = new Srtm30(
                        path, string.Format(path.Split('.')[0] + ".HDR"));
                }
                return(dem);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
 //---------------------------------------------------------------------
 /// <summary>
 /// Loads DEM data depending on the cell size and the avaliable data.
 /// </summary>
 /// <param name="p">
 /// The waypoint that must be included in the DEM.
 /// </param>
 /// <param name="cellSize">
 /// The preferred cell size.
 /// </param>
 /// <param name="demList">
 /// The DEM List where loaded DEMs will added.
 /// </param>
 /// <returns>
 /// The DEM List with the new DEMs included.
 /// </returns>
 //---------------------------------------------------------------------
 public static Dem createDem(Point p, Dem.Precision precision, 
     List<Dem> demList)
 {
     DemType demType = selectDemGenerator(precision);
     Dem dem;
     string path = buildPath(p, demType);
     if (existsPath(demType, path, demList))
     {
         if (demType == DemType.Icc)
             dem = new Icc(path);
         else if (demType == DemType.Srtm3)
             dem = new Srtm3(path);
         else
             dem = new Srtm30(
                     path, string.Format(path.Split('.')[0] + ".HDR"));
         return dem;
     }
     else
         return null;
 }