2 my 123 luntan my_123_luntan 于 2015.07.20 10:51 提问

给镶嵌数据集选择时间字段功能如何实现

一、技术:
arcEngine。
二、功能的位置:
右键.gdb数据库中的镶嵌数据集-->选择属性-->选择“默认”(defalt)选择卡-->找到“目录属性”(catalog Property)-->里面有“时间开始字段”和“时间结束字段”属性。
三、此问题的进展:
使用了以下esri提供的代码,但是右键点击镶嵌数据集属性时还是没有显示相应的时间字段功能,
IMosaicLayer pMosaicLayer = ContextRegistry.GetContext().GetObject("GIS_MosaicLayerClass") as IMosaicLayer;
pMosaicLayer.CreateFromMosaicDataset(mosaicDataset);

ITimeZoneFactory pTZFac = new TimeZoneFactoryClass();

ITimeData pTimeData = pMosaicLayer.InnerObject as ITimeData;
String localTimeZoneId = pTZFac.QueryLocalTimeZoneWindowsID();
ITimeReference timeRef = pTZFac.CreateTimeReferenceFromWindowsID(localTimeZoneId);
if (pTimeData.SupportsTime)
{
pTimeData.UseTime = true;
ITimeTableDefinition pTimeDataDef = pMosaicLayer.InnerObject as ITimeTableDefinition;
//pTimeDataDef.TimeValueFormat = "";

pTimeDataDef.StartTimeFieldName = "USE_STARTDATE";
pTimeDataDef.EndTimeFieldName = "USE_ENDDATE";
pTimeDataDef.TimeReference = timeRef;

                ITimeDataDisplay pTimeAnimProp = pMosaicLayer.InnerObject as ITimeDataDisplay;
                pTimeAnimProp.TimeIntervalUnits = esriTimeUnits.esriTimeUnitsHours;
                pTimeAnimProp.TimeInterval = 12.0;
            }

                            请各位高手指教!!!
Csdn user default icon
上传中...
上传图片
插入图片