Esempio n. 1
0
        public void Save(ContourLine[] contLines, ContourLine.ContourEnvelope envelope, string spatialRef, string fname)
        {
            if (contLines == null || contLines.Length == 0)
            {
                return;
            }
            IContourPersisit persist = new ContourPersist();

            persist.Write(contLines, GeoDo.RSS.RasterTools.ContourPersist.enumCoordType.Prj,
                          envelope, spatialRef, fname);
        }
Esempio n. 2
0
 protected override bool FileHeaderIsOK(string fname, string extName)
 {
     fname += ".contour";
     if (!File.Exists(fname))
     {
         throw new FileNotFoundException("附属文件\"" + Path.GetFileName(fname) + "\"丢失!");
     }
     using (FileStream fs = new FileStream(fname, FileMode.Open))
     {
         using (BinaryReader br = new BinaryReader(fs, Encoding.Unicode))
         {
             char[] fileIdentify = br.ReadChars(ContourPersist.FILE_IDENTIFY.Length);
             return(ContourPersist.FileIdentifyIsOK(fileIdentify));
         }
     }
 }
Esempio n. 3
0
        private static void TryLoadContourValues(string fname, IContourLayer layer)
        {
            string fnameContour = fname + ".contour";

            if (!File.Exists(fnameContour))
            {
                return;
            }
            IContourPersisit persist = new ContourPersist();

            GeoDo.RSS.RasterTools.ContourPersist.enumCoordType coordType;
            string spatialRef;

            ContourLine.ContourEnvelope evp;
            ContourLine[] cntLines = persist.Read(fnameContour, out coordType, out evp, out spatialRef);
            layer.Apply(cntLines, true);
        }