arcEngine获取空间参考系相关参数
作者:互联网
IGeoDataset pGeoDataset = dataset as IGeoDataset;//dataset可为FeatureClass或FeatureDataset
ISpatialReference spatialReference = pGeoDataset.SpatialReference;
if (spatialReference is IProjectedCoordinateSystem){
IProjectedCoordinateSystem2 projectedCoordinateSystem=spatialReference as IProjectedCoordinateSystem2;
string strSpheroidName = projectedCoordinateSystem.GeographicCoordinateSystem.Datum.Spheroid.Name;//获取椭球名称
string strProjectionName=projectedCoordinateSystem.Projection.Name;//投影名称
double dblScaleFactor=projectedCoordinateSystem.ScaleFactor;//尺度因子
double dblLatitudeOfOrigin=projectedCoordinateSystem.LatitudeOfOrigin;//纬度原点
OriginProjectionSetting.strCentralMeridian = Convert.ToString(LidfSurveyFunctions.DegreeToDms(projectedCoordinateSystem.CentralMeridian[true]));//中央子午线
OriginProjectionSetting.XAdditiveConstant = projectedCoordinateSystem.FalseNorthing;//北坐标加常数
OriginProjectionSetting.YAdditiveConstant = projectedCoordinateSystem.FalseEasting;//东坐标加常数
//…………………………等等参数
}else {//is IGeographicCoordinateSystem
IGeographicCoordinateSystem geographicCoordinateSystem=spatialReference as IGeographicCoordinateSystem;
string strSpheroidName = geographicCoordinateSystem.Datum.Spheroid.Name;
double dblSemiMajorAxis = geographicCoordinateSystem.Datum.Spheroid.SemiMajorAxis; //椭球长半轴
//…………………………等等参数
}
标签:projectedCoordinateSystem,Name,string,double,spatialReference,参数,参考系,geographicC 来源: https://blog.csdn.net/nny886/article/details/88694130