Returns the area (float
) of the object.
返回几何对象的面积(浮点类型)。
Returns a (minx, miny, maxx, maxy)
tuple (float
values) that bounds the object.
返回一个表示几何对象边界的元祖(minx, miny, maxx, maxy),即最小外包矩形。
Returns the length (float
) of the object.
返回几何对象的长度(浮点类型)。
Returns the smallest distance by which a node could be moved to produce an invalid geometry.
返回一个节点被移动以产生一个无效的几何形状的最小距离。
This can be thought of as a measure of the robustness of a geometry, where larger values of minimum clearance indicate a more robust geometry. If no minimum clearance exists for a geometry, such as a point, this will return math.infinity.
这可以被认为是衡量一个几何体的稳健性的标准,较大的最小间隙值表明一个更稳健的几何体。如果一个几何体不存在最小间隙,例如一个点,这将返回math.infinity。
New in Shapely 1.7.1 Requires GEOS 3.6 or higher.
>>> from shapely import Polygon
>>> Polygon([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]).minimum_clearance
1.0
Returns a string specifying the Geometry Type of the object in accordance with [1].
返回一个字符串,根据OpenGIS的格式标准指定对象的几何类型。
>>> from shapely import Point, LineString
>>> Point(0, 0).geom_type
'Point'
Returns the minimum distance (float
) to the other geometric object.
返回该几何对象到其他几何对象的最小距离(浮点类型)。
>>> Point(0,0).distance(Point(1,1))
1.4142135623730951
Returns the Hausdorff distance (float
) to the other geometric object. The Hausdorff distance between two geometries is the furthest distance that a point on either geometry can be from the nearest point to it on the other geometry.
返回该几何对象到另一个几何对象的Hausdorff距离(浮点数)。两个几何对象之间的Hausdorff距离是任何一个几何对象上的一个点与另一个几何对象上的最近点之间的最远距离。
New in Shapely 1.6.0
>>> point = Point(1, 1)
>>> line = LineString([(2, 0), (2, 4), (3, 4)])
>>> point.hausdorff_distance(line)
3.605551275463989
>>> point.distance(Point(3, 4))
3.605551275463989
Returns a cheaply computed point that is guaranteed to be within the geometric object.
返回一个在几何对象内的点。该点为标记点,在计算时依照计算量最小而定,至确保在几何对象内部,并不代表几何对象的质心。
Note:This is not in general the same as the centroid.
>>> donut = Point(0, 0).buffer(2.0).difference(Point(0, 0).buffer(1.0))
>>> donut.centroid
<POINT (0 0)>
>>> donut.representative_point()
<POINT (1.498 0.049)>