geopandas.GeoSeries.skew#

GeoSeries.skew(xs=0.0, ys=0.0, origin='center', use_radians=False)[来源]#

返回一个 GeoSeries,其中包含扭曲的几何形状。

几何图形沿着x和y维度按照角度被剪切。

请参见 http://shapely.readthedocs.io/en/latest/manual.html#shapely.affinity.skew 以获取详细信息。

Parameters:
xs, ysfloat, float

x轴和y轴的剪切角。这些可以通过设置use_radians=True以度(默认)或弧度指定。

originstring, Point, or tuple (x, y)

原点可以是一个关键字‘center’用于边界框中心(默认)、‘centroid’用于几何的重心、一个点对象或一个坐标元组 (x, y)。

use_radiansboolean

是否将剪切角度解释为度或弧度

示例

>>> from shapely.geometry import Point, LineString, Polygon
>>> s = geopandas.GeoSeries(
...     [
...         Point(1, 1),
...         LineString([(1, -1), (1, 0)]),
...         Polygon([(3, -1), (4, 0), (3, 1)]),
...     ]
... )
>>> s
0                         POINT (1 1)
1              LINESTRING (1 -1, 1 0)
2    POLYGON ((3 -1, 4 0, 3 1, 3 -1))
dtype: geometry
>>> s.skew(45, 30)
0                                          POINT (1 1)
1                           LINESTRING (0.5 -1, 1.5 0)
2    POLYGON ((2 -1.28868, 4 0.28868, 4 0.71132, 2 ...
dtype: geometry
>>> s.skew(45, 30, origin=(0, 0))
0                                    POINT (2 1.57735)
1         LINESTRING (1.11022e-16 -0.42265, 1 0.57735)
2    POLYGON ((2 0.73205, 4 2.3094, 4 2.73205, 2 0....
dtype: geometry