示例#1
0
        private void RestoreMapProjection(MapWin4Project project, string filename)
        {
            if (project.MapWindow == null)
            {
                return;
            }

            if (project.MapWindow.ProjectProjectionWKT == null && project.MapWindow.ProjectProjection == null)
            {
                Logger.Current.Info("No projection found int the project file: " + filename);
                return;
            }


            var sr = new SpatialReference();

            if (!sr.ImportFromAutoDetect(project.MapWindow.ProjectProjectionWKT))
            {
                if (!sr.ImportFromAutoDetect(project.MapWindow.ProjectProjection))
                {
                    Logger.Current.Info("Failed to parse project projection: " + filename);
                    return;
                }
            }

            _context.SetMapProjection(sr);
        }
示例#2
0
        private void RestoreMapProjection(XmlProject project)
        {
            var sr = new SpatialReference();

            sr.ImportFromAutoDetect(project.Map.Projection);

            _context.SetMapProjection(sr);
        }