xustone01
路人甲
路人甲
  • 注册日期2005-07-23
  • 发帖数2
  • QQ
  • 铜币108枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2459回复:2

求助:IDW计算方法

楼主#
更多 发布于:2005-07-23 14:13
<P>我是一名即将参加数学建模大赛的大学生,哪位仁兄能告诉小弟IDW计算方法的具体内容,谢谢</P><img src="images/post/smile/dvbbs/em12.gif" />
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2005-07-23 18:55
<P>(距离权重倒数)插值算法,你可以在地理信息系统导论上看到一些相关的说明</P>
<P>现在手头没这本书,帮不了你,:)</P>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
astonl
路人甲
路人甲
  • 注册日期2008-05-05
  • 发帖数1
  • QQ
  • 铜币107枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2008-07-15 11:37
<P>void Idw()<BR>{<BR> //这是vc++的程序,应该可以看懂,这里面我是临时从文件夹里提取stations点数据作为插值需</P>
<P>//要的点数据,提取s10这个珊格数据用来设置参数所需要的extent和cellsize</P>
<P>//例子很简单就是VC的类型转换一般人很难想到!而且可用的资料比较少难找到相关的用法</P>
<P> HRESULT hr;<BR> IWorkspaceFactoryPtr ipWSF(CLSID_ShapefileWorkspaceFactory);<BR> IWorkspaceFactoryPtr ipRWSF(CLSID_RasterWorkspaceFactory);<BR> IWorkspacePtr ipWS;<BR> hr=ipWSF->OpenFromFile(CComBSTR("D:/projection/"),NULL,;ipWS);<BR> IFeatureWorkspacePtr ipFWS(ipWS);<BR> IFeatureClassPtr ipFClass;<BR> hr=ipFWS->OpenFeatureClass(CComBSTR("stations.shp"),;ipFClass); </P>
<P> IFeatureClassDescriptorPtr ipFeatureClassDescriptor(CLSID_FeatureClassDescriptor);<BR> hr=ipFeatureClassDescriptor->Create(ipFClass,NULL,CComBSTR("reminder"));</P>
<P> //实利化一个插值操作接口<BR> IInterpolationOp2Ptr ipInterPolationOp(CLSID_RasterInterpolationOp);<BR> IRasterAnalysisEnvironmentPtr ipRasterAnalysisEnv(ipInterPolationOp);<BR> hr=ipRWSF->OpenFromFile(CComBSTR("D:/projection/"),NULL,;ipWS);<BR> IRasterWorkspace2Ptr ipRWS(ipWS);<BR> IRasterDatasetPtr ipTempRD;<BR> hr=ipRWS->OpenRasterDataset(CComBSTR("s10"),;ipTempRD);<BR> IRasterPtr ipRaster;<BR> hr=ipTempRD->CreateDefaultRaster(;ipRaster);<BR> IRasterPropsPtr ipRasterProps(ipRaster);<BR> IRasterBandCollectionPtr ipRBandCol(ipRaster);<BR> IEnvelopePtr ipEnvelope;<BR> ipRasterProps->get_Extent(;ipEnvelope); <BR> hr=ipRasterAnalysisEnv->putref_Mask(IGeoDatasetPtr(ipRaster));<BR> hr=ipRasterAnalysisEnv->putref_OutWorkspace(ipWS);<BR> //AE中很多地方需要用到VARIANT数据对象类型,在这里可以把AE对象放在这个VARIANT容器里,他的用法就是如下<BR> //详细请参看MSDN!<BR> _variant_t pInEnv(ipEnvelope,true);<BR> _variant_t cellsize(ipRaster,true);<BR> //设置插值分析的矩形范围和象素点大小<BR> hr=ipRasterAnalysisEnv->SetExtent(esriRasterEnvValue,;pInEnv,NULL);<BR> hr=ipRasterAnalysisEnv->SetCellSize(esriRasterEnvValue,;cellsize);</P>
<P> IRasterRadiusPtr ipRasterRadius(CLSID_RasterRadius);<BR> hr=ipRasterRadius->SetVariable(12,0);</P>
<P> IGeoDatasetPtr ipGeoDatasetout,ipGeoDatasetinput;<BR> ipGeoDatasetinput=ipFeatureClassDescriptor;<BR> hr=ipInterPolationOp->IDW(ipGeoDatasetinput,2.0,ipRasterRadius,NULL,;ipGeoDatasetout);<BR> IRasterPtr ipRasterout(ipGeoDatasetout);<BR> IRasterLayerPtr ipRasterLayer(CLSID_RasterLayer);<BR> hr=ipRasterLayer->CreateFromRaster(ipRasterout);<BR> hr=m_ipMapControl->AddLayer(ILayerPtr(ipRasterLayer),0);<BR> IActiveViewPtr ipActiveView;<BR> hr=m_ipMapControl->get_ActiveView(;ipActiveView);<BR> hr=ipActiveView->Refresh();</P>
<P>}</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部