Beispiel #1
0
        public static bool GetGeoDatasetPrecision(IGeodatabaseRelease igeodatabaseRelease_0)
        {
            bool flag;
            bool flag1 = true;

            if (igeodatabaseRelease_0 == null)
            {
                flag1 = false;
            }
            else
            {
                try
                {
                    if (igeodatabaseRelease_0.MajorVersion >= 3)
                    {
                        flag = false;
                    }
                    else
                    {
                        flag = (igeodatabaseRelease_0.MajorVersion < 2 ? true : igeodatabaseRelease_0.MinorVersion < 2);
                    }
                    flag1 = (flag ? false : true);
                }
                catch
                {
                }
            }
            return(flag1);
        }
 public static void ChangeCoordinateSystem(IGeodatabaseRelease igeodatabaseRelease_0,
                                           ISpatialReference ispatialReference_0, bool bool_0)
 {
     if (ispatialReference_0 != null)
     {
         bool geoDatasetPrecision            = GeodatabaseTools.GetGeoDatasetPrecision(igeodatabaseRelease_0);
         IControlPrecision2 controlPrecision = ispatialReference_0 as IControlPrecision2;
         if (controlPrecision.IsHighPrecision != geoDatasetPrecision)
         {
             controlPrecision.IsHighPrecision = geoDatasetPrecision;
             double num;
             double num2;
             double num3;
             double num4;
             ispatialReference_0.GetDomain(out num, out num2, out num3, out num4);
             if (bool_0)
             {
                 ISpatialReferenceResolution spatialReferenceResolution =
                     ispatialReference_0 as ISpatialReferenceResolution;
                 spatialReferenceResolution.ConstructFromHorizon();
                 spatialReferenceResolution.SetDefaultXYResolution();
                 ISpatialReferenceTolerance spatialReferenceTolerance =
                     ispatialReference_0 as ISpatialReferenceTolerance;
                 spatialReferenceTolerance.SetDefaultXYTolerance();
             }
         }
     }
 }
Beispiel #3
0
        private void method_0(ISpatialReference ispatialReference_0)
        {
            bool geoDatasetPrecision      = false;
            IGeodatabaseRelease release   = this.iworkspace_0 as IGeodatabaseRelease;
            IControlPrecision2  precision = ispatialReference_0 as IControlPrecision2;

            geoDatasetPrecision       = GeodatabaseTools.GetGeoDatasetPrecision(release);
            precision.IsHighPrecision = geoDatasetPrecision;
            ISpatialReferenceResolution resolution = ispatialReference_0 as ISpatialReferenceResolution;

            resolution.ConstructFromHorizon();
            resolution.SetDefaultXYResolution();
            (ispatialReference_0 as ISpatialReferenceTolerance).SetDefaultXYTolerance();
        }
Beispiel #4
0
        public static bool HighPrecision(IWorkspace pWorkspace)
        {
            IGeodatabaseRelease geoVersion = pWorkspace as IGeodatabaseRelease;

            if (geoVersion == null)
            {
                return(false);
            }
            if (geoVersion.MajorVersion == 2 &&
                geoVersion.MinorVersion == 2)
            {
                return(true);
            }
            return(false);
        }
Beispiel #5
0
        private ISpatialReference method_0(bool bool_1)
        {
            new SpatialReferenceEnvironmentClass();
            ISpatialReference   reference = new UnknownCoordinateSystemClass();
            IGeodatabaseRelease release   = this.ifeatureWorkspace_0 as IGeodatabaseRelease;
            IControlPrecision2  precision = reference as IControlPrecision2;

            bool_1 = GeodatabaseTools.GetGeoDatasetPrecision(release);
            precision.IsHighPrecision = bool_1;
            ISpatialReferenceResolution resolution = reference as ISpatialReferenceResolution;

            resolution.ConstructFromHorizon();
            resolution.SetDefaultXYResolution();
            (reference as ISpatialReferenceTolerance).SetDefaultXYTolerance();
            return(reference);
        }
Beispiel #6
0
        public static bool HighPrecision(IWorkspace pWorkspace)
        {
            bool flag;
            IGeodatabaseRelease geodatabaseRelease = pWorkspace as IGeodatabaseRelease;

            if (geodatabaseRelease != null)
            {
                flag = ((geodatabaseRelease.MajorVersion != 2 ? true : geodatabaseRelease.MinorVersion != 2)
                    ? false
                    : true);
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
Beispiel #7
0
 private void btnUpdatePersonGDB_Click(object sender, EventArgs e)
 {
     try
     {
         IGeodatabaseRelease release = this.iworkspace_0 as IGeodatabaseRelease;
         if (release.CanUpgrade)
         {
             release.Upgrade();
         }
         this.lblGDBRelease.Text         = "此数据库与你所使用的ArcGIS版本匹配";
         this.btnUpdatePersonGDB.Enabled = false;
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
     }
 }
        public static ISpatialReference ConstructCoordinateSystem(IGeodatabaseRelease igeodatabaseRelease_0)
        {
            bool geoDatasetPrecision = GeodatabaseTools.GetGeoDatasetPrecision(igeodatabaseRelease_0);

            ISpatialReference  spatialReference = new UnknownCoordinateSystem() as ISpatialReference;
            IControlPrecision2 controlPrecision = spatialReference as IControlPrecision2;

            controlPrecision.IsHighPrecision = geoDatasetPrecision;
            ISpatialReferenceResolution spatialReferenceResolution = spatialReference as ISpatialReferenceResolution;

            spatialReferenceResolution.ConstructFromHorizon();
            spatialReferenceResolution.SetDefaultXYResolution();
            ISpatialReferenceTolerance spatialReferenceTolerance = spatialReference as ISpatialReferenceTolerance;

            spatialReferenceTolerance.SetDefaultXYTolerance();
            return(spatialReference);
        }
Beispiel #9
0
 private static void ChangeCoordinateSystem(IGeodatabaseRelease igeodatabaseRelease_0,
                                            ISpatialReference ispatialReference_0, bool bool_0)
 {
     if (ispatialReference_0 != null)
     {
         bool geoDatasetPrecision = GeodatabaseTools.GetGeoDatasetPrecision(igeodatabaseRelease_0);
         IControlPrecision2 ispatialReference0 = ispatialReference_0 as IControlPrecision2;
         if (ispatialReference0.IsHighPrecision != geoDatasetPrecision)
         {
             ispatialReference0.IsHighPrecision = geoDatasetPrecision;
             if (bool_0)
             {
                 ISpatialReferenceResolution spatialReferenceResolution =
                     ispatialReference_0 as ISpatialReferenceResolution;
                 spatialReferenceResolution.ConstructFromHorizon();
                 spatialReferenceResolution.SetDefaultXYResolution();
                 (ispatialReference_0 as ISpatialReferenceTolerance).SetDefaultXYTolerance();
             }
         }
     }
 }
Beispiel #10
0
        private void method_0()
        {
            this.textEditName.Text = this.iworkspace_0.PathName;
            switch (this.iworkspace_0.Type)
            {
            case esriWorkspaceType.esriLocalDatabaseWorkspace:
                if (!(Path.GetExtension(this.iworkspace_0.PathName).ToLower() == ".mdb"))
                {
                    this.lblType.Text         = "文件型空间数据库";
                    this.lblConfigKey.Text    = "点击按钮列出数据库定义的所有关键字";
                    this.btnConfigKey.Enabled = true;
                    break;
                }
                this.lblType.Text         = "个人空间数据库";
                this.lblConfigKey.Text    = "个人空间数据库不支持配置关键字";
                this.btnConfigKey.Enabled = false;
                break;

            case esriWorkspaceType.esriRemoteDatabaseWorkspace:
                this.lblType.Text         = "ArcSDE Geodatebase连接";
                this.lblConfigKey.Text    = "点击按钮列出数据库定义的所有关键字";
                this.btnConfigKey.Enabled = true;
                break;
            }
            if (this.iworkspace_0 is IWorkspaceReplicas)
            {
                IEnumReplica replicas = (this.iworkspace_0 as IWorkspaceReplicas).Replicas;
                replicas.Reset();
                IReplica replica2 = replicas.Next();
                string   name     = "";
                if (replica2 != null)
                {
                    this.lblCheckOutInfo.Text         = "这是个检出数据库。该数据库包含从另外的数据库导出的数据。";
                    this.textEditCheckOutName.Enabled = true;
                    name = replica2.Name;
                    this.textEditCheckOutName.Text = name;
                    this.btnProperty.Enabled       = true;
                    this.btnUnRegister.Enabled     = true;
                }
                else
                {
                    this.lblCheckOutInfo.Text         = "该数据库不包含从另外的数据库导出的数据。";
                    this.textEditCheckOutName.Enabled = false;
                    this.btnProperty.Enabled          = false;
                    this.btnUnRegister.Enabled        = false;
                }
            }
            else
            {
                this.lblCheckOutInfo.Text         = "该数据库不包含从另外的数据库导出的数据。";
                this.textEditCheckOutName.Enabled = false;
                this.btnProperty.Enabled          = false;
                this.btnUnRegister.Enabled        = false;
            }
            try
            {
                IGeodatabaseRelease release = this.iworkspace_0 as IGeodatabaseRelease;
                if (release.CurrentRelease)
                {
                    this.lblGDBRelease.Text         = "此数据库与你所使用的ArcGIS版本匹配";
                    this.btnUpdatePersonGDB.Enabled = false;
                }
                else if (release.CanUpgrade)
                {
                    this.lblGDBRelease.Text         = "此数据库与你所使用的ArcGIS版本不匹配";
                    this.btnUpdatePersonGDB.Enabled = true;
                }
                else
                {
                    this.btnUpdatePersonGDB.Enabled = false;
                }
            }
            catch
            {
                this.btnUpdatePersonGDB.Enabled = false;
            }
        }
Beispiel #11
0
 private void method_1(IGeodatabaseRelease igeodatabaseRelease_0, ISpatialReference ispatialReference_2)
 {
     SpatialReferenctOperator.ChangeCoordinateSystem(igeodatabaseRelease_0, ispatialReference_2, true);
 }
Beispiel #12
0
 private ISpatialReference method_0(IGeodatabaseRelease igeodatabaseRelease_0)
 {
     return(SpatialReferenctOperator.ConstructCoordinateSystem(igeodatabaseRelease_0));
 }