ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx

上传人:b****4 文档编号:7696037 上传时间:2023-05-08 格式:DOCX 页数:27 大小:36.48KB
下载 相关 举报
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第1页
第1页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第2页
第2页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第3页
第3页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第4页
第4页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第5页
第5页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第6页
第6页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第7页
第7页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第8页
第8页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第9页
第9页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第10页
第10页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第11页
第11页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第12页
第12页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第13页
第13页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第14页
第14页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第15页
第15页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第16页
第16页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第17页
第17页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第18页
第18页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第19页
第19页 / 共27页
ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx_第20页
第20页 / 共27页
亲,该文档总共27页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx

《ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx(27页珍藏版)》请在冰点文库上搜索。

ArcGIS Server用ITopologicalOperator几何对象与图层范围叠加得到几何面对象Word文档下载推荐.docx

3.{

4.System.Data.DataTabledtFeatures=newDataTable();

5.

6.//QueryDefinition,QueryAgent都是ESRI示例Sample.NETViewer中的类,我把代码附在后面,如果还需要引用其它,你就在EDN的CODEGALLARY中下载

7.示例Sample.NETViewer来参考,下载地址也附在后面

8.QueryDefinitionqueryDef=newQueryDefinition();

9.queryDef.Map=map;

10.queryDef.ResourceName=sResourceName;

11.queryDef.InputLayerID=sLayID;

12.//得到地图服务中的图层

13.QueryAgentqueryAgent=newQueryAgent();

14.if(spatFilterGeometry!

=null)

15.{

16.dtFeatures=queryAgent.QueryMap(queryDef,spatFilterGeometry);

17.}

18.else

19.{

20.dtFeatures=queryAgent.QueryMap(queryDef);

21.}

22.//如何将几何字段与空间选择的范围相交得到

23.ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionalityags_mapfunctionality=(ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality)map.GetFunctionality(sResourceName);

24.ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocalags_mapresourcelocal=(ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal)

25.ags_mapfunctionality.Resource;

26.ESRI.ArcGIS.Server.IServerContextserverContext=ags_mapresourcelocal.ServerContextInfo.ServerContext;

27.GeometrygeomIntersect=null;

28.if(dtFeatures.Rows.Count!

=0)

29.{

30.ESRI.ArcGIS.ADF.Web.Geometry.GeometrygeoLay=dtFeatures.Rows[0]["

SHAPE"

]asESRI.ArcGIS.ADF.Web.Geometry.Geometry;

31.//将ADF对象转为AO对象

32.ESRI.ArcGIS.Geometry.IGeometrygeoLayIGeom=ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToIGeometry(geoLay,serverContext);

33.ESRI.ArcGIS.Geometry.IGeometryspatFilterIGeom=ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToIGeometry(spatFilterGeometry,serverContext);

34.//将AO对象转为ITopologicalOperator对象

35.ESRI.ArcGIS.Geometry.ITopologicalOperatortopoOp=geoLayIGeomasESRI.ArcGIS.Geometry.ITopologicalOperator;

//得到ITopologicalOperator:

Intersect的结果,是AO对象

36.ESRI.ArcGIS.Geometry.IGeometrycomGeomIntersect=topoOp.Intersect(spatFilterIGeom,ESRI.ArcGIS.Geometry.esriGeometryDimension.esriGeometry2Dimension)asESRI.ArcGIS.Geometry.IGeometry;

37.//将AO对象转为SPECIALAPI:

ESRI.ArcGIS.ADF.ArcGISServer对象

38.ESRI.ArcGIS.ADF.ArcGISServer.PolygonNAGSPolyN=ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ComObjectToValueObject(comGeomIntersect,serverContext,typeof(ESRI.ArcGIS.ADF.ArcGISServer.PolygonN))asESRI.ArcGIS.ADF.ArcGISServer.PolygonN;

39.ESRI.ArcGIS.ADF.ArcGISServer.GeometryAGSGeomIntersect=AGSPolyNasESRI.ArcGIS.ADF.ArcGISServer.Geometry;

40.//最后将SPECIALAPI:

ESRI.ArcGIS.ADF.ArcGISServer对象转回为COMMONAPI一般的ADF对象

41.geomIntersect=ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToAdfGeometry(AGSGeomIntersect);

42.}

43.returngeomIntersect;

44.}

复制代码

回复引用

TOP

6#

发表于2010-5-1414:

24|只看该作者

36编辑

附件有3.6M,我只能传小于1M的,把地址发给你,自己去下载吧,要注册有用户名才能下

如果直接链接不上,就在CODEGALLERY里找2008年12月31日的

Sample.NETViewer

TheExample.NETViewerisawebmappingapplicationbuildonthe9.3SP1ArcGISServer.NETApplicationDeveloperFramework.TheExample.NETViewerincludessamplesourcecodefor:

-Drawing(Shapes,Graphics,Labels)-TabularResultsDisplay-AddingMapServices-FeatureSelection(QueryBuilding,Buffering,GeometrySelection)-GeoRSSSupport-ExportMapImage&

PrintMapTasks-ChangingSelectionSymbols-Navigation...

关注2009年ArcGIS&

ENVI校园行活动

7#

26|只看该作者

社区公告

ESRI社区近期管理规则!

(关于注册、发帖等事项)

QueryAgent类

1.usingSystem;

2.usingSystem.Collections.Generic;

3.usingSystem.Text;

4.usingSystem.Data;

5.usingESRI.ArcGIS.ADF;

6.usingESRI.ArcGIS.ADF.Web;

7.usingESRI.ArcGIS.ADF.Web.UI.WebControls;

8.usingESRI.ArcGIS.ADF.Web.DataSources;

9.usingESRI.ArcGIS.ADF.Web.Display.Graphics;

10.usingESRI.ArcGIS.ADF.Web.Geometry;

11.usingSystem.Collections;

12.

13.namespaceESRI.Solutions.NITK.Interrogation.QueryBuilder

14.{

15. 

 

internalclassQueryAgent

16. 

{

17. 

 

privatestaticreadonlylog4net.ILog_log=log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

18. 

19. 

publicQueryAgent()

20. 

{

21. 

}

22.

23. 

publicDataTableQuerySampleFieldValues(QueryDefinitionqueryDef,stringsFieldName)

24. 

25. 

_log.Debug("

Queryingsamplefieldvalues"

);

26.

27. 

Mapmap=queryDef.Map;

28. 

DataTableqdatatable=null;

29.

30. 

//Buildqueryfilter

31. 

QueryFilterqueryFilter=newQueryFilter();

32. 

queryFilter.SubFields=newStringCollection(sFieldName,'

'

33. 

queryFilter.WhereClause=queryDef.Expression;

34. 

queryFilter.MaxRecords=queryDef.MaxRecords;

35.

36. 

//Aquirehandletoqueryfunctionality

37. 

IMapFunctionalitymapFunct=queryDef.Map.GetFunctionality(queryDef.ResourceName);

38. 

IGISResourcegisResource=mapFunct.Resource;

39. 

TypetypeFunct=typeof(IQueryFunctionality);

40. 

boolbQueryFunctSupported=gisResource.SupportsFunctionality(typeFunct);

41.

42. 

if(bQueryFunctSupported)

43. 

44. 

//Performquery

45. 

IQueryFunctionalityqfunc=(IQueryFunctionality)gisResource.CreateFunctionality(typeFunct,null);

46. 

_log.Debug("

QuerySampleFieldValues():

Startquerying.InputLayerID:

"

+queryDef.InputLayerID);

47. 

qdatatable=qfunc.Query(null,queryDef.InputLayerID,queryFilter);

48.

49. 

if(qdatatable.Columns[sFieldName]!

50. 

51. 

qdatatable=RemoveDuplicateRows(qdatatable,sFieldName);

52. 

}

53. 

54. 

else

55. 

56. 

StringsErrMsg=String.Format(Strings.errResouceDoesntSupportIQueryFunctionality,queryDef.ResourceName);

57. 

_log.Error(sErrMsg);

58. 

thrownewException(sErrMsg);

59. 

60.

61. 

returnqdatatable;

62. 

63.

64. 

publicDataTableRemoveDuplicateRows(DataTabledTable,stringcolName)

65. 

66. 

HashtablehTable=newHashtable();

67. 

ArrayListduplicateList=newArrayList();

68.

69. 

foreach(DataRowdrowindTable.Rows)

70. 

71. 

if(hTable.Contains(drow[colName]))

72. 

73. 

//Can'

tremovefromdatatableduringtheiterationsoweneedtokeepalistofduplicates.

74. 

duplicateList.Add(drow);

75. 

76. 

else

77. 

78. 

//Addrowvalueaskeytohashtabletochecktheduplicate.

79. 

hTable.Add(drow[colName],string.Empty);

80. 

81. 

82.

83. 

//Removetheduplicaterowsthatalreadyexistsinhashtable.

84. 

foreach(DataRowdRowinduplicateList)

85. 

86. 

dTable.Rows.Remove(dRow);

87. 

88. 

returndTable;

89. 

90.

91. 

publicDataTableQueryMap(QueryDefinitionqueryDef)

92. 

93. 

Queryingmap"

94. 

95. 

96. 

97. 

98. 

99. 

100. 

queryFilter.SubFields=queryDef.FieldList;

101. 

102. 

queryFilter.ReturnADFGeometries=true;

103.

104.// 

SpatialFilterspatFilter=newSpatialFilter();

105.// 

spatFilter.WhereClause=queryDef.Expression;

;

106.

107. 

108. 

109. 

110. 

111. 

112.

113. 

114. 

115. 

116. 

117. 

118.

119. 

if(qdatatable==null)

120. 

121. 

_log.Error("

QueryMap:

Mapqueryreturnednulldatatable"

122. 

thrownewQueryFailedException(Strings.errQueryFailed);

123. 

124. 

125. 

126. 

127. 

StringsErrMsg=String.Format(Strings.errResouceDoes

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2