创建空间参考

//创建空间参考
ISpatialReference pSpatialReference = GetSpatialReferenc(mTimeTrackPoint);
Dictionary<string,esriFieldType>pFieldStruct = new Dictionary<string,esriFieldType>();
//添加字段
string pStartTime = "StartTime";
string pEndTime = "EndTime";
pFieldStruct.Add(pStartTime, esriFieldType.esriFieldTypeString);
pFieldStruct.Add(pEndTime, esriFieldType.esriFieldTypeString);

/// <summary>
/// 获取要素类空间参考方法。
/// </summary>
/// <param name="pFeatureLayer">要获取空间参考的图层</param>
/// <returns>图层空间参考</returns>
private static ISpatialReference GetSpatialReferenc(IFeatureLayer pFeatureLayer)
{
IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
IGeoDataset pGeoDataset = pFeatureClass as IGeoDataset;
ISpatialReference pSpatialReference = pGeoDataset.SpatialReference;
return pSpatialReference;
}

posted @ 2017-06-07 16:37  基石  阅读(190)  评论(0编辑  收藏  举报