阅读:2321回复:7
VC+MO中如何进行buffer分析
<TABLE width="90%" border=0>
<TR> <TD width="100%"><IMG src="http://www.gischina.com/bbs/face/em01.gif" border=0> <B>VC+MO中如何进行buffer分析</B> <FONT color=#dfebff>--------------------------------------------------------------------</FONT> 已经通过查询函数取的用户选择的直线line; CMoRectangle rect; VARIANT vRect; rect = line.GetExtent(); vRect.vt = VT_DISPATCH; vRect.pdispVal = rect; CMoPolygon* poly = new CMoPolygon(line.Buffer(1000,vRect)); 但是poly为空,请问有没有作个缓冲区分析的高手请指点</TD></TR></TABLE> |
|
1楼#
发布于:2008-05-06 01:18
<P>最近在想做一个类似的东西,看了以后有点启发哦~~~~~~~~</P>
<P>多谢了</P> |
|
2楼#
发布于:2004-10-10 16:30
<P>我做的!!</P><P>vector<CMoPolygon> CreateBuffer(CMoRecordset; BufferRecords, double; BufferTolerance, int; BufferLayerStyle, string; BufferUnits)
{ vector<CMoPolygon> TempVectorPoly; CComVariant Extent(m_map.GetFullExtent().m_lpDispatch); if (BufferUnits == "千米") BufferTolerance = 1000 * BufferTolerance; switch (BufferLayerStyle) { case 0://点图层 { BufferRecords.MoveFirst(); while (!BufferRecords.GetEof()) { CMoPoint point(BufferRecords.GetFields().Item(CComVariant("Shape")).GetValue().pdispVal); CMoPolygon PolygonBuffer(point.Buffer(BufferTolerance,Extent)); TempVectorPoly.push_back(PolygonBuffer); BufferRecords.MoveNext(); } break; } case 1://线图层 { BufferRecords.MoveFirst(); while (!BufferRecords.GetEof()) { CMoLine line(BufferRecords.GetFields().Item(CComVariant("Shape")).GetValue().pdispVal); CMoPolygon PolygonBuffer(line.Buffer(BufferTolerance,Extent)); TempVectorPoly.push_back(PolygonBuffer); BufferRecords.MoveNext(); } break; } case 2://面图层 { BufferRecords.MoveFirst(); while (!BufferRecords.GetEof()) { CMoPolygon Polygon(BufferRecords.GetFields().Item(CComVariant("Shape")).GetValue().pdispVal); CMoPolygon PolygonBuffer(Polygon.Buffer(BufferTolerance,Extent)); TempVectorPoly.push_back(PolygonBuffer); BufferRecords.MoveNext(); } break; } } return TempVectorPoly; }</P> |
|
|
3楼#
发布于:2004-10-10 16:03
<P>我还是不太懂,我是这么写的</P><P>CMoSymbol symBuffer;
symBuffer.CreateDispatch(TEXT("MapObjects2.Symbol")); symBuffer.SetSymbolType(moFillSymbol); symBuffer.SetStyle(moLightGrayFill); symBuffer.SetColor(Color); symBuffer.SetOutline(FALSE);</P><P> CMoPolygon shpBuffer; VARIANT va; VariantInit(;va); va.vt=VT_DISPATCH;</P><P> va.pdispVal=g_searchLine.GetExtent(); //此时g_searchLine已赋值 shpBuffer=g_searchLine.Buffer(100,va);</P><P>为什么我执行到最后一句总是出错呢?应该怎么做? </P> |
|
4楼#
发布于:2004-10-09 17:01
建议:rect 取 m_map.GetFullExtent();
|
|
|
5楼#
发布于:2004-10-08 09:05
<img src="images/post/smile/dvbbs/em04.gif" /><img src="images/post/smile/dvbbs/em04.gif" />
|
|
|
6楼#
发布于:2004-10-07 10:29
<P>多谢!</P>
|
|
7楼#
发布于:2004-10-06 21:20
<P><a href="http://gisempire.com/bbs/dispbbs.asp?BoardID=39;ID=5491" target="_blank" >http://gisempire.com/bbs/dispbbs.asp?BoardID=39;ID=5491</A></P><P>这是一个vb的例子</P>
|
|
|