dask_geopandas.GeoSeries.rotate#

GeoSeries.rotate(angle, origin='center', use_radians=False)#

Returns a GeoSeries with rotated geometries.

This docstring was copied from geopandas.base.GeoPandasBase.rotate.

Some inconsistencies with the Dask version may exist.

See http://shapely.readthedocs.io/en/latest/manual.html#shapely.affinity.rotate for details.

Parameters:
anglefloat

The angle of rotation can be specified in either degrees (default) or radians by setting use_radians=True. Positive angles are counter-clockwise and negative are clockwise rotations.

originstring, Point, or tuple (x, y)

The point of origin can be a keyword ‘center’ for the bounding box center (default), ‘centroid’ for the geometry’s centroid, a Point object or a coordinate tuple (x, y).

use_radiansboolean

Whether to interpret the angle of rotation as degrees or radians

Examples

>>> 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.00000 1.00000)
1       LINESTRING (1.00000 -1.00000, 1.00000 0.00000)
2    POLYGON ((3.00000 -1.00000, 4.00000 0.00000, 3...
dtype: geometry
>>> s.rotate(90)  
0                              POINT (1.00000 1.00000)
1      LINESTRING (1.50000 -0.50000, 0.50000 -0.50000)
2    POLYGON ((4.50000 -0.50000, 3.50000 0.50000, 2...
dtype: geometry
>>> s.rotate(90, origin=(0, 0))  
0                             POINT (-1.00000 1.00000)
1        LINESTRING (1.00000 1.00000, 0.00000 1.00000)
2    POLYGON ((1.00000 3.00000, 0.00000 4.00000, -1...
dtype: geometry