Esempio n. 1
0
        private ISpatialReference GetSpatialReference(ESRI.ArcGIS.Geometry.esriSRGeoCSType FactoryCode)
        {
            ISpatialReferenceFactory    oSpatialReferenceFactory;
            IGeographicCoordinateSystem oGCS;

            try
            {
                oSpatialReferenceFactory = new SpatialReferenceEnvironment();
                oGCS = oSpatialReferenceFactory.CreateGeographicCoordinateSystem((int)FactoryCode);
                return(oGCS);
            }
            catch
            {
                return(null);
            }
        }
Esempio n. 2
0
        public ISpatialReference GetSpatialReference(ESRI.ArcGIS.Geometry.esriSRGeoCSType FactoryCode)
        {
            ISpatialReferenceFactory    oSpatialReferenceFactory;
            IGeographicCoordinateSystem oGCS;

            try
            {
                Type t = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
                oSpatialReferenceFactory = (ISpatialReferenceFactory)Activator.CreateInstance(t);
                oGCS = oSpatialReferenceFactory.CreateGeographicCoordinateSystem((int)FactoryCode);
                return(oGCS);
            }
            catch
            {
                return(null);
            }
        }