获取ARCGIS中polygon的中心点坐标

本文介绍如何使用Field Calculation工具在ArcMap中计算Polygon图层的中心点坐标,并将结果保存到指定字段。通过VBA代码实现X坐标和Y坐标的自动填充。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

获取polygon的中心点坐标
使用field calculation。下面是arcgis help里的讲解:
Adding the x,y coordinates of the centroid of a polygon layer to a new field
1. Optionally, start an edit session in ArcMap. Calculating a field is faster outside of an edit session, but you won't be able to undo the calculation.
2. Open the attribute table of the layer of the layer you want to edit.
3. Right-click the field heading for the X field (if there is no X field you can add a new field by clicking the options button and selecting the new field option).
4. Click Calculate Values.
5. Check Advanced.
6. Type the following VBA statement in the first text box.
Dim dblX As DoubleDim pArea As IAreaSet pArea = [Shape]dblX = pArea.Centroid.X
7. Type the variable dblX in the text box directly under the X field name.
8. Click OK.
You can repeat the same process for updating a field with the Y coordinates for the centroid point of each polygon in the layer.
Tip 中国3S吧 3s8.cn
• The property X returns a field type of double. For best results, your X field should also be a double field type.
### Unity 内置渲染管线与 URP (Universal Render Pipeline) 的区别 #### 渲染架构差异 Unity 内置渲染管线采用较为传统的单通道或多通道延迟渲染方式,其灵活性较低。相比之下,URP 是基于 Scriptable Render Pipeline(SRP),允许开发者自定义渲染流程中的各个阶段[^1]。 #### 性能优化特性 对于移动设备和其他资源受限平台而言,URP 提供了更高效的性能表现。这是因为 URP 支持更低级别的硬件访问控制以及更好的批处理能力,从而减少了绘制调用次数并提高了帧率稳定性[^4]。 #### Shader 和材质支持 在内置渲染管线中使用的着色器主要依赖于 Surface Shaders 或者 Handwritten Vertex/Pixel Shaders 。然而,在 URP 下则完全迁移到 HLSL 并引入了新的 Material Properties ,这不仅简化了开发过程还增强了跨平台兼容性。 #### 特殊效果实现 当涉及到复杂视觉特效如屏幕空间环境光遮蔽(Ambient Occlusion)时,两者都提供了相应的解决方案。但在具体实现上有所区别;例如,在 URP 中可以通过编写自定义 Passes 来增强此类功能的效果质量[^3]。 ```csharp // 示例:如何在一个简单的 URP shader 中添加 AO 效果 Shader "Custom/AOExample" { SubShader { Tags { "RenderType"="Opaque" } Pass { Name "AO" HLSLPROGRAM #pragma vertex vert #pragma fragment frag struct Attributes { float4 positionOS : POSITION; float2 uv : TEXCOORD0; }; struct Varyings { float4 posHCS : SV_POSITION; float2 uv : TEXCOORD0; }; sampler2D _MainTex; Varyings vert(Attributes input) { Varyings output; output.posHCS = TransformObjectToHClip(input.positionOS); output.uv = input.uv; return output; } half4 frag(Varyings input) : SV_Target { // 假设我们已经有了一个可以获取 SSAO 数据的方法 GetScreenSpaceAmbientOcclusion() half aoValue = GetScreenSpaceAmbientOcclusion(input.uv); // 应用 AO 到最终颜色输出 half4 color = tex2D(_MainTex, input.uv); color.rgb *= lerp(1.0, aoValue, 0.75); return color; } ENDHLSL } } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值