Geometry

ArcGIS 10

汇总

Geometry objects define a spatial location and an associated geometric shape.

讨论

在许多地理处理工作流中,您可能需要使用坐标和几何信息运行特定操作,但不一定想经历创建新(临时)要素类、使用光标填充要素类、使用要素类,然后删除临时要素类的过程。可以使用几何对象替代输入和输出,从而使地理处理变得更简单。可以使用 Geometry、Multipoint、PointGeometry、Polygon 或 Polyline 类从头开始创建几何对象。

语法

Geometry (geometry, inputs, {spatialReference}, {hasZ}, {hasM})

参数

说明

数据类型

geometry

The geometry type: point, polygon, polyline, or multipoint.

String

inputs

The coordinates used to create the object. The datatype can be either Point or Array objects.

Object

spatialReference

The spatial reference of the new geometry.

(默认值为None)

SpatialReference

hasZ

The Z state: True for geometry if Z is enabled and False if it is not.

(默认值为False)

Boolean

hasM

The M state: True for geometry if M is enabled and False if it is not.

(默认值为False)

Boolean

属性

属性

说明

数据类型

area

(只读)

The area of a polygon feature. Empty for all other feature types.

Double

centroid

(只读)

The true centroid if it is within or on the feature; otherwise, the label point is returned. Returns a point object.

Point

extent

(只读)

The extent of the geometry.

Extent

firstPoint

(只读)

The first coordinate point of the geometry.

Point

hullRectangle

(只读)

A space-delimited string of the coordinate pairs of the convex hull rectangle.

String

isMultipart

(只读)

True, if the number of parts for this geometry is more than one.

Boolean

labelPoint

(只读)

The point at which the label is located. The labelPoint is always located within or on a feature.

Point

lastPoint

(只读)

The last coordinate of the feature.

Point

length

(只读)

The length of the linear feature. Zero for point, multipoint feature types.

Double

partCount

(只读)

The number of geometry parts for the feature.

Integer

pointCount

(只读)

The total number of points for the feature.

Integer

trueCentroid

(只读)

The center of gravity for a feature.

Point

type

(只读)

The geometry type: polygon, polyline, point, multipoint, multipatch, dimension, annotation.

String

方法概述

方法

说明

contains (second_geometry)

Indicates if the base geometry contains the comparison geometry.

contains is the opposite of within.

Only True relationships are shown in this illustration.

crosses (second_geometry)

Indicates if the two geometries intersect in a geometry of a lesser shape type.

Two polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and an polygon cross if they share a polyline or a point (for vertical line) in common on the interior of the polygon which is not equivalent to the entire polyline.

Only True relationships are shown in this illustration.

disjoint (second_geometry)

Indicates if the base and comparison geometries share no points in common.

Two geometries intersect if disjoint returns False.

Only True relationships are shown in this illustration.

equals (second_geometry)

Indicates if the base and comparison geometries are of the same shape type and define the same set of points in the plane.

Only True relationships are shown in this illustration.

getPart ({index})

Returns an array of point objects for a particular part of geometry or an array containing a number of arrays, one for each part.

overlaps (second_geometry)

Indicates if the intersection of the two geometries has the same shape type as one of the input geometries and is not equivalent to either of the input geometries.

Only True relationships are shown in this illustration.

touches (second_geometry)

Indicates if the boundaries of the geometries intersect.

Two geometries touch when the intersection of the geometries is not empty, but the intersection of their interiors is empty. For example, a point touches a polyline only if the point is coincident with one of the polyline end points.

Only True relationships are shown in this illustration.

within (second_geometry)

Indicates if the base geometry is within the comparison geometry.

within is the opposite operator of contains.

Only True relationships are shown in this illustration.

方法

contains (second_geometry)

参数

说明

数据类型

second_geometry

A second geometry.

Object

返回值数据类型

说明

Boolean

A return Boolean value of True indicates this geometry contains the second geometry.

crosses (second_geometry)

参数

说明

数据类型

second_geometry

A second geometry.

Object

返回值数据类型

说明

Boolean

A return Boolean value of True indicates the two geometries intersect in a geometry of a lesser shape type.

disjoint (second_geometry)

参数

说明

数据类型

second_geometry

A second geometry.

Object

返回值数据类型

说明

Boolean

A return Boolean value of True indicates that the two geometries share no points in common.

equals (second_geometry)

参数

说明

数据类型

second_geometry

A second geometry.

Object

返回值数据类型

说明

Boolean

A return Boolean value of True indicates that the two geometries are of the same shape type and define the same set of points in the plane.

getPart ({index})

参数

说明

数据类型

index

The index position of the geometry.

Integer

返回值数据类型

说明

Array

getPart returns an array of point objects for a particular part of the geometry if an index is specified. If an index is not specified, an array containing an array of point objects for each geometry part is returned.

overlaps (second_geometry)

参数

说明

数据类型

second_geometry

A second geometry.

Object

返回值数据类型

说明

Boolean

A return Boolean value of True indicates the intersection of the two geometries has the same dimension as one of the input geometries.

touches (second_geometry)

参数

说明

数据类型

second_geometry

A second geometry.

Object

返回值数据类型

说明

Boolean

A return Boolean value of True indicates the boundaries of the geometries intersect.

within (second_geometry)

参数

说明

数据类型

second_geometry

A second geometry.

Object

返回值数据类型

说明

Boolean

A return Boolean value of True indicates this geometry is contained within the second geometry.

代码示例

Geometry example

When you set the output parameter of a geoprocessing tool to a empty Geometry object, the tool will return a list of Geometry objects.

import arcpy

# Create an empty Geometry object

#

g = arcpy.Geometry()

# Run the CopyFeatures tool, setting the output to the geometry object. GeometryList

# is returned as a list of geometry objects.

#

geometryList = arcpy.CopyFeatures_management("c:/data/streets.shp", g)

# Walk through each geometry, totalling the length

#

length = 0

for geometry in geometryList:

length += geometry.length

print "Total length: %f" % length

python geometry参数_python arcgis Geometry | 学步园相关推荐

  1. python 表示图论_Python 图论工具 | 学步园

    networkx: 一个用Python语言开发的图论与复杂网络建模工具, 内置了常用的图与复杂网络分析 可以方便的进行复杂网络数据分析.仿真建模等工作. 依赖工具: numpy pyparsing d ...

  2. python魔法参数_python中的魔法参数:*args和**kwargs

    def foo(*args, **kwargs): print 'args = ', args print 'kwargs = ', kwargs print '------------------- ...

  3. python 启动参数_python启动参数

    广告关闭 腾讯云11.11云上盛惠 ,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高返5000元! 开发准备cas 的 python sdk 包含了用于访问和操作 cas 的所有 ...

  4. python绘制四边形_python shapely.geometry.polygon任意两个四边形的IOU计算实例

    在目标检测中一个很重要的问题就是NMS及IOU计算,而一般所说的目标检测检测的box是规则矩形框,计算IOU也非常简单,有两种方法: 1. 两个矩形的宽之和减去组合后的矩形的宽就是重叠矩形的宽,同比重 ...

  5. python 地址_python 解析地址 | 学步园

    socekt.getaddrinfo的返回值介绍 family: 表示socket使用的协议簇.常用的协议簇包括AF_UNIX(本机通信)/AF_INET(TCP/IP协议簇中的IPv4协议)/AF_ ...

  6. python语言下划线怎么打_python下划线 | 学步园

    Python 用下划线作为变量前缀和后缀指定特殊变量 _xxx 不能用'from module import *'导入 __xxx__ 系统定义名字 __xxx 类中的私有变量名 核心风格:避免用下划 ...

  7. python分句_Python 中文分句 | 学步园

    # coding: utf-8 #设置分句的标志符号:可以根据实际需要进行修改 cutlist =".!?".decode('utf-8') #检查某字符是否分句标志符号的函数:如 ...

  8. python可变参数_Python 的四种共享传参详解

    点击上方"Python数据之道",选择"星标公众号" 精品文章,第一时间送达 作者 | 杨仁聪 编辑 | Lemon 出品 | Python数据之道 本文来自公 ...

  9. python动态参数_python动态参数

    Python的动态参数有两种,分别是*args和**kwargs,这里面的关键是一个和两个星号的区别,而不是args和kwargs在名字上的区别,实际上你可以使用*any或**whatever的方式. ...

最新文章

  1. 潜力的监控mysql_Grafana 数据库监控平台
  2. 修复windows脸部识别_如何在Windows 10中改善面部识别
  3. MySQL数据库模式(SQL_MODE)中的STRICT_TRANS_TABLES和STRICT_ALL_TABLES
  4. ABP入门系列(14)——应用BootstrapTable表格插件
  5. Linux 服务器惊现比特币勒索事件,腾讯云安全专家来支招
  6. 兼顾pc和移动端的textarea字数监控的实现方法
  7. 远程办公的 33 种预测
  8. linux登录vnc的命令行,用VNC远程登陆linux (ZT)
  9. mysql升级到8.0.17_windows10更换mysql8.0.17详细教程
  10. NPM酷库050:xmlbuilder,创建XML文件
  11. 微信小程序登陆界面(效果图+源代码)
  12. ETR290规范的理解
  13. matepad能升级鸿蒙吗,华为平板有鸿蒙系统吗2021
  14. 不应将商业行为政治化!
  15. UVa1218完美的服务
  16. 百度小程序api怎么提交?Python推送代码免费分享给大家
  17. 非递归遍历二叉树(后序遍历)
  18. 人生就是修炼,修什么?
  19. 广东培正计算机科学与技术,广东培正学院数据科学与计算机学院
  20. (二十四)优秀员工 - 9

热门文章

  1. 我的计算机管理怎么打不开,为什么打不开"计算机管理"
  2. db block gets、consistent gets和physical reads
  3. css溢出文本省略号
  4. mysql on delete_MySQL ON DELETE CASCADE
  5. 【论文阅读】Automatic Detection of Various Malicious Traffic Using Side Channel Features on TCP Packets
  6. 最新蓝色网址/公众号导航站源码+Yzmcms内核开发
  7. 去年年会小品——山寨实话实说
  8. 黑马程序员——Java基础——网络编程1
  9. Java分布式跟踪系统Zipkin(六):Brave源码分析-Brave和SpringBoot整合
  10. 基于 Springboot 的 Bark 通知辅助处理项目