MapObjects2自带例子的问题

MapObjects2\Samples\VBNet\Geometry例子里的空间几何图形的集合运算有这样一个方法:

Private Function MakeExtentFromXYScale(falseX As Double, falseY As Double, xyScale As Double) 
As Rectangle
		' max integer for positive integer coord space
		Dim c_maxGeomInt As  Long =  2147483645
		Dim ext As New Rectangle
		
		' Shift origin left and down to match the precision
		ext.Left = Int(falseX * xyScale) / xyScale
		ext.Bottom = Int(falseY * xyScale) / xyScale
    
		' Set width and height of the rectangle to be a square which is sized
		' fill positive integer space at the given scale
		ext.Right = ext.Left + c_maxGeomInt / xyScale
	  ext.Top = ext.Bottom + ext.Right - ext.Left

		MakeExtentFromXYScale = ext
End Function
它是用在空间图形Shape(Point、Ellipse、Rectangle、Line)之间的运算(Union、Difference…),原形为:
ShapeFirst.Union(ShapeSecond,Rectangle)
其中,第二个参数是调用上面的方法来获取的,它的实际意义是:当前要进行几何运算的两个图形所占的最小矩形,而如果
调用上面的方法来获得该矩形在不同比例尺下运算出来的效果是不一样的,通常是有外围轮廓的出现,达不到实际效果。
Google一下找不到答案,之前有见过一篇文章,是ESRI Forum 上关于该问题的。是ESRI 自带例子的错误。
解决方法:
第二个参数直接获取当前地图的Extent就可以了:this._map.Extent;
 
posted @ 2007-04-01 00:48  Doho  阅读(785)  评论(0编辑  收藏  举报