当前位置: 首页 > news >正文

如何做优惠券网站广东哪里网站建设

如何做优惠券网站,广东哪里网站建设,西亚网站建设科技,建设银行北京招聘网站ArcGIS Pro SDK #xff08;八#xff09;地理数据库 8 拓扑 文章目录 ArcGIS Pro SDK #xff08;八#xff09;地理数据库 8 拓扑1 开放拓扑和进程定义2 获取拓扑规则3 验证拓扑4 获取拓扑错误5 标记和不标记为错误6 探索拓扑图7 找到最近的元素 环境#xff1a;Visual …ArcGIS Pro SDK 八地理数据库 8 拓扑 文章目录 ArcGIS Pro SDK 八地理数据库 8 拓扑1 开放拓扑和进程定义2 获取拓扑规则3 验证拓扑4 获取拓扑错误5 标记和不标记为错误6 探索拓扑图7 找到最近的元素 环境Visual Studio 2022 .NET6 ArcGIS Pro SDK 3.0 1 开放拓扑和进程定义 public void OpenTopologyAndProcessDefinition() {// 从文件地理数据库中打开拓扑并处理拓扑定义。using (Geodatabase geodatabase new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(C:\TestData\GrandTeton.gdb))))using (Topology topology geodatabase.OpenDatasetTopology(Backcountry_Topology)){ProcessDefinition(geodatabase, topology);}// 打开要素服务拓扑并处理拓扑定义。const string TOPOLOGY_LAYER_ID 0;using (Geodatabase geodatabase new Geodatabase(new ServiceConnectionProperties(new Uri(https://sdkexamples.esri.com/server/rest/services/GrandTeton/FeatureServer))))using (Topology topology geodatabase.OpenDatasetTopology(TOPOLOGY_LAYER_ID)){ProcessDefinition(geodatabase, topology);} }private void ProcessDefinition(Geodatabase geodatabase, Topology topology) {// 类似于Core.Data API中其余Definition对象打开数据集的定义有两种方式 -- 通过拓扑数据集本身或通过地理数据库。using (TopologyDefinition definitionViaTopology topology.GetDefinition()){OutputDefinition(geodatabase, definitionViaTopology);}using (TopologyDefinition definitionViaGeodatabase geodatabase.GetDefinitionTopologyDefinition(Backcountry_Topology)){OutputDefinition(geodatabase, definitionViaGeodatabase);} }private void OutputDefinition(Geodatabase geodatabase, TopologyDefinition topologyDefinition) {Console.WriteLine($拓扑聚类容差 {topologyDefinition.GetClusterTolerance()});Console.WriteLine($拓扑Z值聚类容差 {topologyDefinition.GetZClusterTolerance()});IReadOnlyListstring featureClassNames topologyDefinition.GetFeatureClassNames();Console.WriteLine($有 {featureClassNames.Count} 个要素类参与了拓扑:);foreach (string name in featureClassNames){// 打开每个参与拓扑的要素类。using (FeatureClass featureClass geodatabase.OpenDatasetFeatureClass(name))using (FeatureClassDefinition featureClassDefinition featureClass.GetDefinition()){Console.WriteLine($\t{featureClass.GetName()} ({featureClassDefinition.GetShapeType()}));}} }2 获取拓扑规则 using (TopologyDefinition topologyDefinition topology.GetDefinition()) {IReadOnlyListTopologyRule rules topologyDefinition.GetRules();Console.WriteLine($拓扑定义了 {rules.Count} 条拓扑规则:);Console.WriteLine(ID \t 源类 \t 源子类 \t 目标类 \t 目标子类 \t 规则类型);foreach (TopologyRule rule in rules){Console.Write(${rule.ID});Console.Write(!String.IsNullOrEmpty(rule.OriginClass) ? $\t{rule.OriginClass} : \t\\);Console.Write(rule.OriginSubtype ! null ? $\t{rule.OriginSubtype.GetName()} : \t\\);Console.Write(!String.IsNullOrEmpty(rule.DestinationClass) ? $\t{rule.DestinationClass} : \t\\);Console.Write(rule.DestinationSubtype ! null ? $\t{rule.DestinationSubtype.GetName()} : \t\\);Console.Write($\t{rule.RuleType});Console.WriteLine();} }3 验证拓扑 public void ValidateTopology() {using (Geodatabase geodatabase new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(C:\TestData\GrandTeton.gdb))))using (Topology topology geodatabase.OpenDatasetTopology(Backcountry_Topology)){// 如果拓扑当前没有脏区域调用Validate()将返回一个空的包络线。ValidationResult result topology.Validate(new ValidationDescription(topology.GetExtent()));Console.WriteLine($在未编辑的拓扑上验证后的受影响区域 {result.AffectedArea.ToJson()});// 现在创建一个故意违反“PointProperlyInsideArea”拓扑规则的要素。这个动作将创建脏区域。Feature newFeature null;try{// 获取Campsite要素类中ObjectID为2的要素。然后从这个要素稍微修改后创建一个新的几何体并用它创建一个新的要素。using (Feature featureViaCampsites2 GetFeature(geodatabase, Campsites, 2)){Geometry currentGeometry featureViaCampsites2.GetShape();Geometry newGeometry GeometryEngine.Instance.Move(currentGeometry, (currentGeometry.Extent.XMax / 8),(currentGeometry.Extent.YMax / 8));using (FeatureClass campsitesFeatureClass featureViaCampsites2.GetTable())using (FeatureClassDefinition definition campsitesFeatureClass.GetDefinition())using (RowBuffer rowBuffer campsitesFeatureClass.CreateRowBuffer()){rowBuffer[definition.GetShapeField()] newGeometry;geodatabase.ApplyEdits(() {newFeature campsitesFeatureClass.CreateRow(rowBuffer);});}}// 在Campsites参与要素类中创建新要素后拓扑的状态应为“未分析”因为尚未验证。Console.WriteLine($应用编辑后拓扑状态 {topology.GetState()});// 现在验证拓扑。结果包络线对应于脏区域。result topology.Validate(new ValidationDescription(topology.GetExtent()));Console.WriteLine($在刚编辑后验证的拓扑上的受影响区域 {result.AffectedArea.ToJson()});// 在Validate()之后拓扑的状态应为“有错误的分析”因为拓扑当前存在错误。Console.WriteLine($验证拓扑后的拓扑状态 {topology.GetState()});// 如果没有脏区域则结果包络线应为空。result topology.Validate(new ValidationDescription(topology.GetExtent()));Console.WriteLine($在刚验证过的拓扑上的受影响区域 {result.AffectedArea.ToJson()});}finally{if (newFeature ! null){geodatabase.ApplyEdits(() {newFeature.Delete();});newFeature.Dispose();}}// 删除新创建的要素后再次验证。topology.Validate(new ValidationDescription(topology.GetExtent()));} }private Feature GetFeature(Geodatabase geodatabase, string featureClassName, long objectID) {using (FeatureClass featureClass geodatabase.OpenDatasetFeatureClass(featureClassName)){QueryFilter queryFilter new QueryFilter(){ObjectIDs new Listlong() { objectID }};using (RowCursor cursor featureClass.Search(queryFilter)){System.Diagnostics.Debug.Assert(cursor.MoveNext());return (Feature)cursor.Current;}} }4 获取拓扑错误 // 获取当前与拓扑相关的所有错误和异常。IReadOnlyListTopologyError allErrorsAndExceptions topology.GetErrors(new ErrorDescription(topology.GetExtent())); Console.WriteLine($错误和异常数目 {allErrorsAndExceptions.Count});Console.WriteLine(源类名称 \t 源对象ID \t 目标类名称 \t 目标对象ID \t 规则类型 \t 是否异常 \t 几何类型 \t 几何宽度 高度 \t 规则ID \t);foreach (TopologyError error in allErrorsAndExceptions) {Console.WriteLine(${error.OriginClassName} \t {error.OriginObjectID} \t {error.DestinationClassName} \t ${error.DestinationObjectID} \t {error.RuleType} \t {error.IsException} \t {error.Shape.GeometryType} \t ${error.Shape.Extent.Width},{error.Shape.Extent.Height} \t {error.RuleID}); }5 标记和不标记为错误 // 获取所有由于违反“PointProperlyInsideArea”拓扑规则而引起的错误。using (TopologyDefinition topologyDefinition topology.GetDefinition()) {TopologyRule pointProperlyInsideAreaRule topologyDefinition.GetRules().First(rule rule.RuleType TopologyRuleType.PointProperlyInsideArea);ErrorDescription errorDescription new ErrorDescription(topology.GetExtent()){TopologyRule pointProperlyInsideAreaRule};IReadOnlyListTopologyError errorsDueToViolatingPointProperlyInsideAreaRule topology.GetErrors(errorDescription);Console.WriteLine($有 {errorsDueToViolatingPointProperlyInsideAreaRule.Count} 个要素违反了PointProperlyInsideArea拓扑规则.);// 将违反“PointProperlyInsideArea”拓扑规则的所有错误标记为异常。foreach (TopologyError error in errorsDueToViolatingPointProperlyInsideAreaRule){topology.MarkAsException(error);}// 现在验证所有违反“PointProperlyInsideArea”拓扑规则的错误是否确实已标记为异常。//// 默认情况下ErrorDescription初始化为ErrorType.ErrorAndException。在这里我们想要ErrorType.ErrorOnly。errorDescription new ErrorDescription(topology.GetExtent()){ErrorType ErrorType.ErrorOnly,TopologyRule pointProperlyInsideAreaRule};IReadOnlyListTopologyError errorsAfterMarkedAsExceptions topology.GetErrors(errorDescription);Console.WriteLine($在将所有错误标记为异常后有 {errorsAfterMarkedAsExceptions.Count} 个要素违反了PointProperlyInsideArea拓扑规则.);// 最后通过取消标记为异常将所有异常重置为错误。foreach (TopologyError error in errorsDueToViolatingPointProperlyInsideAreaRule){topology.UnmarkAsException(error);}IReadOnlyListTopologyError errorsAfterUnmarkedAsExceptions topology.GetErrors(errorDescription);Console.WriteLine($在将所有异常重置为错误后有 {errorsAfterUnmarkedAsExceptions.Count} 个要素违反了PointProperlyInsideArea拓扑规则.); }6 探索拓扑图 public void ExploreTopologyGraph() {using (Geodatabase geodatabase new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(C:\TestData\GrandTeton.gdb))))using (Topology topology geodatabase.OpenDatasetTopology(Backcountry_Topology)){// 使用拓扑数据集的范围构建拓扑图。topology.BuildGraph(topology.GetExtent(),(topologyGraph) {using (Feature campsites12 GetFeature(geodatabase, Campsites, 12)){IReadOnlyListTopologyNode topologyNodesViaCampsites12 topologyGraph.GetNodes(campsites12);TopologyNode topologyNodeViaCampsites12 topologyNodesViaCampsites12[0];IReadOnlyListTopologyEdge allEdgesConnectedToNodeViaCampsites12 topologyNodeViaCampsites12.GetEdges();IReadOnlyListTopologyEdge allEdgesConnectedToNodeViaCampsites12CounterClockwise topologyNodeViaCampsites12.GetEdges(false);System.Diagnostics.Debug.Assert(allEdgesConnectedToNodeViaCampsites12.Count allEdgesConnectedToNodeViaCampsites12CounterClockwise.Count);foreach (TopologyEdge edgeConnectedToNodeViaCampsites12 in allEdgesConnectedToNodeViaCampsites12){TopologyNode fromNode edgeConnectedToNodeViaCampsites12.GetFromNode();TopologyNode toNode edgeConnectedToNodeViaCampsites12.GetToNode();bool fromNodeIsTheSameAsTopologyNodeViaCampsites12 (fromNode topologyNodeViaCampsites12);bool toNodeIsTheSameAsTopologyNodeViaCampsites12 (toNode topologyNodeViaCampsites12);System.Diagnostics.Debug.Assert(fromNodeIsTheSameAsTopologyNodeViaCampsites12 || toNodeIsTheSameAsTopologyNodeViaCampsites12,连接到topologyNodeViaCampsites12的每个边的FromNode或ToNode应与topologyNodeViaCampsites12本身相同。);IReadOnlyListFeatureInfo leftParentFeaturesBoundedByEdge edgeConnectedToNodeViaCampsites12.GetLeftParentFeatures();foreach (FeatureInfo featureInfo in leftParentFeaturesBoundedByEdge){System.Diagnostics.Debug.Assert(!String.IsNullOrEmpty(featureInfo.FeatureClassName));System.Diagnostics.Debug.Assert(featureInfo.ObjectID 0);EnsureShapeIsNotEmpty(featureInfo);}IReadOnlyListFeatureInfo leftParentFeaturesNotBoundedByEdge edgeConnectedToNodeViaCampsites12.GetLeftParentFeatures(false);foreach (FeatureInfo featureInfo in leftParentFeaturesNotBoundedByEdge){System.Diagnostics.Debug.Assert(!String.IsNullOrEmpty(featureInfo.FeatureClassName));System.Diagnostics.Debug.Assert(featureInfo.ObjectID 0);EnsureShapeIsNotEmpty(featureInfo);}IReadOnlyListFeatureInfo rightParentFeaturesBoundedByEdge edgeConnectedToNodeViaCampsites12.GetRightParentFeatures();foreach (FeatureInfo featureInfo in rightParentFeaturesBoundedByEdge){System.Diagnostics.Debug.Assert(!String.IsNullOrEmpty(featureInfo.FeatureClassName));System.Diagnostics.Debug.Assert(featureInfo.ObjectID 0);EnsureShapeIsNotEmpty(featureInfo);}IReadOnlyListFeatureInfo rightParentFeaturesNotBoundedByEdge edgeConnectedToNodeViaCampsites12.GetRightParentFeatures(false);foreach (FeatureInfo featureInfo in rightParentFeaturesNotBoundedByEdge){System.Diagnostics.Debug.Assert(!String.IsNullOrEmpty(featureInfo.FeatureClassName));System.Diagnostics.Debug.Assert(featureInfo.ObjectID 0);EnsureShapeIsNotEmpty(featureInfo);}}}});} }private void EnsureShapeIsNotEmpty(FeatureInfo featureInfo) {using (Feature feature featureInfo.GetFeature()){System.Diagnostics.Debug.Assert(!feature.GetShape().IsEmpty, 要素的形状不应为空。);} }7 找到最近的元素 public void FindClosestElement() {using (Geodatabase geodatabase new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(C:\TestData\GrandTeton.gdb))))using (Topology topology geodatabase.OpenDatasetTopology(Backcountry_Topology)){// 使用拓扑数据集的范围构建拓扑图。topology.BuildGraph(topology.GetExtent(), (topologyGraph) {MapPoint queryPointViaCampsites12 null;using (Feature campsites12 GetFeature(geodatabase, Campsites, 12)){queryPointViaCampsites12 campsites12.GetShape() as MapPoint;}double searchRadius 1.0;TopologyElement topologyElementViaCampsites12 topologyGraph.FindClosestElementTopologyElement(queryPointViaCampsites12, searchRadius);System.Diagnostics.Debug.Assert(topologyElementViaCampsites12 ! null, 在searchRadius范围内应该有一个与queryPointViaCampsites12对应的拓扑元素.);IReadOnlyListFeatureInfo parentFeatures topologyElementViaCampsites12.GetParentFeatures();Console.WriteLine(生成topologyElementViaCampsites12的父要素:);foreach (FeatureInfo parentFeature in parentFeatures){Console.WriteLine($\t{parentFeature.FeatureClassName}; OID: {parentFeature.ObjectID});}TopologyNode topologyNodeViaCampsites12 topologyGraph.FindClosestElementTopologyNode(queryPointViaCampsites12, searchRadius);if (topologyNodeViaCampsites12 ! null){// 在searchRadius单位内存在一个最近的TopologyNode。}TopologyEdge topologyEdgeViaCampsites12 topologyGraph.FindClosestElementTopologyEdge(queryPointViaCampsites12, searchRadius);if (topologyEdgeViaCampsites12 ! null){// 在searchRadius单位内存在一个最近的TopologyEdge。}});} }
http://www.tj-hxxt.cn/news/132684.html

相关文章:

  • 浙江省建设厅干部学校网站主流网站 技术
  • php 网站模板网站总体规划
  • 基于网站开发小程序建立百度网站
  • 建设电子商务系统网站汽车网址
  • 男女做暧暧视频免费网站网站建设业务员招聘
  • 怎么做企业网站原型网站界面设计修改要多少钱
  • 社群网站建设赣州网上房地产
  • 南宁定制建站网络公司给我做网站我有没有源代码版权吗
  • 重庆制作网站公司哪家好在厦门做网站找谁
  • 网站建设制作设计公司长春营销型网站设计
  • 怎么做网站图片做餐饮要看的网站
  • 如何查看网站域名wordpress主题去版权乱码
  • WordPress网站动漫你在wordpress菜单参数设置
  • 如何在外管局网站上做a合同襄阳做网站哪家好
  • 网站建设公司的成本有哪些方面长沙个人做网站
  • 类型: 营销型网站建设wordpress 4.4.7
  • 专业的会议网站建设香蜜湖附近网站建设
  • 有做数学题的网站吗北仑宁波有没有做网站
  • 双流规划建设管理局网站沧州高端网站建设公司
  • 河北手机网站制作多少钱网站开发 工资高吗
  • 紫色网站网站搭建框架是什么
  • 类似中企动力的做网站的临沂网络网站建设
  • 网站是用虚拟机做还是服务器苏州个人网站建设
  • 长春网站制作设计网站开发 不好 怎么说
  • 烟台网站建设方案图片在线设计平台
  • 阿里云网站托管成都网站优化多少钱
  • 南宁企业建站程序网站建设网页设计师
  • 怎么建网站教程视频appcdn加速国外服务器
  • 网站开发demo最新新闻热点事件摘抄2022年5月
  • 湛江做网站带数据库的网站模板下载