Пример #1
0
        public static FileDataSource FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(null);
            }
            string name = null;

            if (ele.Attribute("name") != null)
            {
                name = ele.Attribute("name").Value;
            }
            string fileurl = ele.Attribute("fileurl").Value;
            string fname   = MapFactory.GetFullFilename(fileurl);

            if (!File.Exists(fname))
            {
                return(null);
            }
            FileDataSource ds = new FileDataSource(name, fname);

            if (ele.Element("ArgsOfLeveling") != null)
            {
                ds.SetArgOfLevel(ArgOfLeveling.FromXElement(ele.Element("ArgsOfLeveling")));
            }
            return(ds);
        }
Пример #2
0
        public static IRasterDataSource FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(null);
            }
            string name = null;

            if (ele.Attribute("name") != null)
            {
                name = ele.Attribute("name").Value;
            }
            string            url   = ele.Attribute("url").Value;
            string            fname = MapFactory.GetFullFilename(url);
            IRasterDataSource ds    = new RasterDataSource(fname);

            return(ds);
        }