Geos Series Accessor#
- class pgpd.GeosSeriesAccessor(obj)#
Access shapely functionality through the “geos” series accessor keyword.
Example
>>> s = pd.Series(shapely.points(range(15), 0), dtype='geos') >>> s 0 POINT (0 0) 1 POINT (1 0) 2 POINT (2 0) 3 POINT (3 0) 4 POINT (4 0) 5 POINT (5 0) 6 POINT (6 0) 7 POINT (7 0) 8 POINT (8 0) 9 POINT (9 0) dtype: geos >>> s.geos.has_z 0 False 1 False 2 False 3 False 4 False 5 False 6 False 7 False 8 False 9 False Name: has_z, dtype: bool
Serialization#
Serialization & Deserialization functionality.
Transform the series in a shapely geos column. |
|
Convert a geos Series into a |
|
Geometry#
Methods from Shapely Geometry Properties.
Returns the dimensionality of the coordinates in a geometry (2 or 3). |
|
Returns the inherent dimensionality of a geometry. |
|
Returns the exterior ring of a polygon. |
|
Returns the nth geometry from a collection of geometries. |
|
Returns the nth interior ring of a polygon. |
|
Returns the total number of coordinates in a geometry. |
|
Returns number of geometries in a collection. |
|
Returns number of internal rings in a polygon |
|
Returns number of points in a linestring or linearring. |
|
Gets parts of each GeometryCollection or Multi* geometry object; returns a copy of each geometry in the GeometryCollection or Multi* geometry object. |
|
Returns the nth point of a linestring or linearring. |
|
Get the precision of a geometry. |
|
Gets rings of Polygon geometry object. |
|
Returns the SRID of a geometry. |
|
Returns the type ID of a geometry. |
|
Returns the x-coordinate of a point |
|
Returns the y-coordinate of a point |
|
Returns the z-coordinate of a point. |
|
Forces the dimensionality of a geometry to 2D. |
|
Forces the dimensionality of a geometry to 3D. |
|
Returns geometry with the precision set to a precision grid size. |
|
Returns a geometry with its SRID set. |
Geometry Creation#
Methods from Shapely Geometry Creation.
Destroy the prepared part of a geometry, freeing up memory. |
|
Prepare a geometry, improving performance of other operations. |
Measurement#
Methods from Shapely Measurement.
Computes the area of a (multi)polygon. |
|
Computes the bounds (extent) of a geometry. |
|
Computes the Cartesian distance between two geometries. |
|
Compute the discrete Fréchet distance between two geometries. |
|
Compute the discrete Hausdorff distance between two geometries. |
|
Computes the length of a (multi)linestring or polygon perimeter. |
|
Computes the radius of the minimum bounding circle that encloses an input geometry. |
|
Computes the Minimum Clearance distance. |
|
Computes the total bounds (extent) of the geometry. |
Predicates#
Methods from Shapely Predicates.
Returns True if geometry B is completely inside geometry A. |
|
Returns True if geometry B is completely inside geometry A, with no common boundary points. |
|
Returns True if no point in geometry A is outside geometry B. |
|
Returns True if no point in geometry B is outside geometry A. |
|
Returns True if A and B spatially cross. |
|
Returns True if A and B do not share any point in space. |
|
Returns True if A and B are spatially equal. |
|
Returns True if A and B are structurally equal. |
|
Returns True if a geometry has a Z coordinate. |
|
Returns True if A and B share any portion of space. |
|
Returns True if a linestring or linearring is counterclockwise. |
|
Returns True if a linestring's first and last points are equal. |
|
Returns True if a geometry is an empty point, polygon, etc. |
|
Returns True if the object is a geometry |
|
Returns True if the object is not a geometry (None) |
|
Returns True if a Geometry is prepared. |
|
Returns True if a linestring is closed and simple. |
|
Returns True if a Geometry has no anomalous geometric points, such as self-intersections or self tangency. |
|
Returns True if a geometry is well formed. |
|
Returns True if the object is a geometry or None |
|
Returns a string stating if a geometry is valid and if not, why. |
|
Returns True if A and B spatially overlap. |
|
Returns a string representation of the DE-9IM intersection matrix. |
|
Returns True if the DE-9IM string code for the relationship between the geometries satisfies the pattern, else False. |
|
Returns True if the only points shared between A and B are on the boundary of A and B. |
|
Returns True if geometry A is completely inside geometry B. |
Set Operations#
Methods from Shapely Set Operations.
Merges multiple polygons into one. |
|
Returns the union of multiple polygons of a geometry collection. |
|
Returns the part of geometry A that does not intersect with geometry B. |
|
Returns the geometry that is shared between input geometries. |
|
Returns the intersection of multiple geometries. |
|
Returns the geometry that represents the portions of input geometries that do not intersect. |
|
Returns the symmetric difference of multiple geometries. |
|
Merges geometries into one. |
|
Returns the union of multiple geometries. |
Constructive Operations#
Methods from Shapely Constructive Operations.
Returns the topological boundary of a geometry. |
|
Computes the buffer of a geometry for positive and negative buffer distance. |
|
Creates an areal geometry formed by the constituent linework of given geometry. |
|
Computes the geometric center (center-of-mass) of a geometry. |
|
Returns the portion of a geometry within a rectangle. |
|
Computes the minimum convex geometry that encloses an input geometry. |
|
Computes a Delaunay triangulation around the vertices of an input geometry. |
|
Computes the minimum bounding box that encloses an input geometry. |
|
Returns all distinct vertices of an input geometry as a multipoint. |
|
Repairs invalid geometries. |
|
Computes the minimum bounding circle that encloses an input geometry. |
|
Computes the oriented envelope (minimum rotated rectangle) that encloses an input geometry, such that the resulting rectangle has minimum area. |
|
Converts Geometry to normal form (or canonical form). |
|
Returns a (Multi)LineString at a distance from the object on its right or its left side. |
|
Computes the oriented envelope (minimum rotated rectangle) that encloses an input geometry, such that the resulting rectangle has minimum area. |
|
Returns a point that intersects an input geometry. |
|
Creates polygons formed from the linework of a set of Geometries. |
|
Returns a copy of a Geometry with the order of coordinates reversed. |
|
Adds vertices to line segments based on maximum segment length. |
|
Returns a simplified version of an input geometry using the Douglas-Peucker algorithm. |
|
Snaps an input geometry to reference geometry's vertices. |
|
Computes a Voronoi diagram from the vertices of an input geometry. |
Linestring Operations#
Methods from Shapely Linestring Operations.
Returns a point interpolated at given distance on a line. |
|
Returns the distance to the line origin of given point. |
|
Returns (Multi)LineStrings formed by combining the lines in a MultiLineString. |
|
Returns the shared paths between geom1 and geom2. |
|
Returns the shortest line between two geometries. |
Coordinate Operations#
Methods from Shapely Coordinate Operations.
Returns a copy of a geometry array with a function applied to its coordinates. |
|
Counts the number of coordinate pairs in a geometry array. |
|
Gets coordinates from a geometry array as an array of floats. |
|
Gets coordinates from a geometry array as an array of floats. |
|
Adapts the coordinates of a geometry array in-place. |
STRTree#
Methods from Shapely STRTree.
A query-only R-tree spatial index created using the Sort-Tile-Recursive (STR) [1]_ algorithm. |
Custom#
Custom methods to add more functionality.
Performs a 2D or 3D affine transformation on all the coordinates. |
|
Performs a 2D or 3D rotation on all the coordinates. |
|
Performs a 2D or 3D scaling on all the coordinates. |
|
Performs a 2D or 3D skew/shear transformation on all the coordinates. |
|
Performs a 2D or 3D translation on all the coordinates. |