Skyline_Analysis65_ContourMap_SlopeMap

              Skyline的分析模块中一直有一个等高线的专题图功能,这个功能一直都被我忽略这,老版本接口不开放,而且就固定那些颜色没什么意思,6.5 版本把这个功能的接口开放出来了那就有点意思了。


先来说CreateGontourMap接口的参数。
//一组矩形的坐标。UpperLeftX, UpperLeftY, LowerRightX,LowerRightY, 
//定义等高兴专题图样式,是线还是色差。 这个里我定义的是色差。
ContourDisplayStyle DisplayStyle = ContourDisplayStyle .CDS_CONTOUR_STYLE_COLORS;

//画板的ID,定义使用什么样的色差类型。 这个GUID值来自 TerraExplorerPro安装目录下 xml文件中的定义。 一会详细解释
string PaletteID = "9fecd8a0-6e3b-11e0-ae3e-0800200c9a66" ;

//组ID
string GroupID = "" ;

string Description = "ContourMap" ;

//根据参数创建一个等高线的专题图,返回专题图对象
IContourMap65 iContourMap = sg65.Analysis.CreateContourMap(UpperLeftX, UpperLeftY, LowerRightX, LowerRightY, DisplayStyle, PaletteID, GroupID, Description);

IColor65 iColor65 = sg65.Creator.CreateColor((int) Color.Red.R, (int )Color.Red.G, ( int)Color .Red.B);
iContourMap.ContourLinesColor = iColor65;

//定义专题图对象的采样间隔
iContourMap.ContourLinesInterval = 1;

//定义等高线专题图的覆盖类型,是区域还是全球。
//iContourMap.CoverageArea = CoverageArea.CA_ENTIRE_TERRAIN;
效果如下:

下面详细说明一下
 string PaletteID = "9fecd8a0-6e3b-11e0-ae3e-0800200c9a66" ;
开发文档是这么写的。

PaletteID The GUID for the palette. GUIDs are listed in the palette XMLs found in the Pseudo directory, which is located under the [TerraExplorer installation]\ Lang\1033 folder and under %APPDATA%\Skyline\TerraExplorer.

       这个是调色板的GUID.GUID列在调色板的XML虚拟目录中找到,位于下 TerraExplorer安装目录下的Lang\1033\Pseudo。
找一个出来看一下。 划横线的就是GUID的值。
<?xml version=' 1.0' encoding=' ISO8859-1' ?>
<?xml-stylesheet type='text/xsl' href='Pseudo.xsl'?>
<!--Skyline TerraBuilder Pseudo File Copyright (c) 2002)-->
<PseudoColors>
  <Caption> Gray</Caption >
  <GUID> E7B822F7-380F-4d67-B050-85E870D5301F </GUID>
  <Range>
    < Max>2200.000000 </Max>
    < Min>-350.000000 </Min>
  </Range>
  <Data>
    < Num>2 </Num>
    < Node>
      < Val>2200.000000 </Val>
      < Color>FFFFFF </Color>
    </ Node>
    < Node>
      < Val>-350.000000 </Val>
      < Color>303030 </Color>
    </ Node>
  </Data>
</PseudoColors>
CreateSlopeMap 创建效果如下代码下载


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
A year and a half year ago, I published this article to the Codeguru site and got a number of requests about the Kriging algorithm contour map. Unfortunately, my project was changed shortly after that article and later I quit the company so I couldn‘t find time to finish this Contour business. A week ago, I happened to need a contour map again so I decided to solve the Kriging algorithm. I searched the Internet for a commercial library but they all look ugly and hard to use. So, I made up my mind to make my own algorithm. The Kriging algorithm is easy to find, but this algorithm needs a Matrix and solver (LU-Decomposition). Again, I couldn‘t find suitable code for this. I tried to use GSL first but this made my code too big and was slower. Finally, I went back to "Numerical Recipe in C"—yes, that horrible-looking C code—and changed the code there to my taste.If you read this article before, the rendering part hasn‘t been changed much. I added the Kriging algorithm and revised the codes a little bit. Following is the Kriging Algorithm:templatedouble GetDistance(const ForwardIterator start, int i, int j){ return ::sqrt(::pow(((*(start+i)).x - (*(start+j)).x), 2) + ::pow(((*(start+i)).y - (*(start+j)).y), 2));}templatedouble GetDistance(double xpos, double ypos, const ForwardIterator start, int i){ return ::sqrt(::pow(((*(start+i)).x - xpos), 2) + ::pow(((*(start+i)).y - ypos), 2));}templateclass TKriging : public TInterpolater{public: TKriging(const ForwardIterator first, const ForwardIterator last, double dSemivariance) : m_dSemivariance(dSemivariance) { m_nSize = 0; ForwardIterator start = first; while(start != last) { ++m_nSize; ++start; } m_matA.SetDimension(m_nSize, m_nSize); for(int j=0; j<m_nSize; j++) { for(int i=0; i<m_nSize; i++) { if(i == m_nSize-1 || j == m_nSize-1) { m_matA(i, j) = 1; if(i == m_nSize-1 && j == m_nSize-1) m_matA(i, j) = 0; continue; } m
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值