|
阅读:1292回复:1
[求助]缓冲区分析
在缓冲区分析中有三种方法,其中属性权值缓冲区(以分析对象的属性值作为权值建立缓冲区),分级缓冲区(建立一个给定环个数和间距的分级缓冲区)怎么在vc中实现,函数是怎样的?
|
|
|
1楼#
发布于:2007-11-02 17:24
<P>Sub exampleITopologicalOperator_Buffer()<BR>Dim ptc As IPointCollection, i As Long, pa As IArea, ptopo As ITopologicalOperator<BR>Dim pt(4) As IPoint, poutPoly As IPolygon<BR>Set ptc = New Polygon<BR>'The spatial reference should be set here using IGeometry::SpatialReference (Code skipped here)<BR>For i = 0 To 4<BR> Set pt(i) = New Point<BR>Next<BR>pt(0).PutCoords 0, 0<BR>pt(1).PutCoords 0, 10<BR>pt(2).PutCoords 10, 10<BR>pt(3).PutCoords 10, 0<BR>pt(4).PutCoords 0, 0<BR>ptc.AddPoints 5, pt(0)<BR>Set pa = ptc<BR>Debug.Print "Area original polygon : " ; pa.Area<BR>Set ptopo = ptc<BR>Set poutPoly = ptopo.Buffer(1) 'Outside buffer<BR>Set pa = poutPoly<BR>Debug.Print "Area polygon positive distance : " ; pa.Area<BR>Set poutPoly = ptopo.Buffer(-1) 'Inside buffer<BR>Set pa = poutPoly<BR>Debug.Print "Area polygon negative distance : " ; pa.Area<BR>End Sub</P>
|
|