GeoSeries
polars_st.GeoSeries #
GeoSeries(
name: str | ArrayLike | None = None,
values: ArrayLike | None = None,
dtype: PolarsDataType | None = None,
*,
strict: bool = True,
nan_to_null: bool = False,
geometry_format: (
Literal[
"wkb",
"wkt",
"ewkt",
"geojson",
"shapely",
"coords",
"point",
"multipoint",
"linestring",
"circularstring",
"multilinestring",
"polygon",
]
| None
) = None
)
Bases: Series
Create a new GeoSeries.
GeoSeries
is used as an alias for pl.Series
with type annotations added for the
st
namespace, and an overriden constructor which will parse
the values into binary EWKB format.
You can create a GeoSeries from a list of coordinate arrays, WKB, WKT, EWKT or GeoJSON
strings, or Shapely objects. If geometry_format
is not set, the geometries will be
created by infering the correct deserialization operation from its datatype.
See pl.Series
for parameters documentation.
Note
Because Polars doesn't support subclassing of their types, calling this constructor will
NOT create an instance of GeoSeries
, but an instance of pl.Series
.
As a result, instance checks are not permitted on this class to prevent misuse:
Examples:
>>> gs = st.GeoSeries([
... "POINT(0 0)",
... "POINT(1 2)",
... ])
>>> gs2 = st.GeoSeries([
... [0, 0],
... [1, 2],
... ], geometry_format="point")
>>> gs.equals(gs2)
True
>>> import shapely
>>> gs = st.GeoSeries([
... shapely.Point(0, 0),
... shapely.Point(1, 2),
... ])
>>> gs2 = st.GeoSeries([
... '{"type": "Point", "coordinates": [0, 0]}',
... '{"type": "Point", "coordinates": [1, 2]}',
... ])
>>> gs.equals(gs2)
True
polars_st.GeoSeriesNameSpace #
polars_st.GeoSeriesNameSpace.__geo_interface__
property
#
__geo_interface__: dict
Return a GeoJSON GeometryCollection dict
representation of the DataFrame.
polars_st.GeoSeriesNameSpace.geometry_type #
polars_st.GeoSeriesNameSpace.coordinate_dimension #
polars_st.GeoSeriesNameSpace.minimum_clearance #
polars_st.GeoSeriesNameSpace.count_coordinates #
polars_st.GeoSeriesNameSpace.coordinates #
coordinates(output_dimension: Literal[2, 3] | None = None) -> Series
polars_st.GeoSeriesNameSpace.interior_rings #
polars_st.GeoSeriesNameSpace.count_interior_rings #
polars_st.GeoSeriesNameSpace.get_interior_ring #
get_interior_ring(index: IntoIntegerExpr) -> GeoSeries
polars_st.GeoSeriesNameSpace.count_geometries #
polars_st.GeoSeriesNameSpace.get_geometry #
get_geometry(index: IntoIntegerExpr) -> GeoSeries
polars_st.GeoSeriesNameSpace.count_points #
polars_st.GeoSeriesNameSpace.get_point #
get_point(index: IntoIntegerExpr) -> GeoSeries
polars_st.GeoSeriesNameSpace.set_precision #
set_precision(
grid_size: IntoNumericExpr,
mode: Literal["valid_output", "no_topo", "keep_collapsed"] = "valid_output",
) -> GeoSeries
polars_st.GeoSeriesNameSpace.distance #
distance(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.hausdorff_distance #
hausdorff_distance(
other: IntoGeoExprColumn, densify: float | None = None
) -> Series
polars_st.GeoSeriesNameSpace.frechet_distance #
frechet_distance(
other: IntoGeoExprColumn, densify: float | None = None
) -> Series
polars_st.GeoSeriesNameSpace.set_srid #
set_srid(srid: IntoIntegerExpr) -> GeoSeries
polars_st.GeoSeriesNameSpace.to_srid #
to_srid(srid: IntoIntegerExpr) -> GeoSeries
polars_st.GeoSeriesNameSpace.to_wkt #
polars_st.GeoSeriesNameSpace.to_ewkt #
polars_st.GeoSeriesNameSpace.to_wkb #
polars_st.GeoSeriesNameSpace.to_geopandas #
Convert this pl.Series to a geopandas GeoSeries.
polars_st.GeoSeriesNameSpace.is_valid_reason #
polars_st.GeoSeriesNameSpace.crosses #
crosses(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.contains #
contains(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.contains_properly #
contains_properly(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.covered_by #
covered_by(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.covers #
covers(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.disjoint #
disjoint(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.dwithin #
dwithin(other: IntoGeoExprColumn, distance: float) -> Series
polars_st.GeoSeriesNameSpace.intersects #
intersects(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.overlaps #
overlaps(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.touches #
touches(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.within #
within(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.equals #
equals(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.equals_exact #
equals_exact(other: IntoGeoExprColumn, tolerance: float = 0.0) -> Series
polars_st.GeoSeriesNameSpace.equals_identical #
equals_identical(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.relate #
relate(other: IntoGeoExprColumn) -> Series
polars_st.GeoSeriesNameSpace.relate_pattern #
relate_pattern(other: IntoGeoExprColumn, pattern: str) -> Series
polars_st.GeoSeriesNameSpace.union #
union(other: IntoGeoExprColumn, grid_size: float | None = None) -> GeoSeries
polars_st.GeoSeriesNameSpace.unary_union #
polars_st.GeoSeriesNameSpace.intersection #
intersection(
other: IntoGeoExprColumn, grid_size: float | None = None
) -> GeoSeries
polars_st.GeoSeriesNameSpace.difference #
difference(
other: IntoGeoExprColumn, grid_size: float | None = None
) -> GeoSeries
polars_st.GeoSeriesNameSpace.symmetric_difference #
symmetric_difference(
other: IntoGeoExprColumn, grid_size: float | None = None
) -> GeoSeries
polars_st.GeoSeriesNameSpace.buffer #
polars_st.GeoSeriesNameSpace.offset_curve #
offset_curve(
distance: IntoNumericExpr,
quad_segs: int = 8,
join_style: Literal["round", "mitre", "bevel"] = "round",
mitre_limit: float = 5.0,
) -> GeoSeries
polars_st.GeoSeriesNameSpace.clip_by_rect #
clip_by_rect(
xmin: IntoNumericExpr,
ymin: IntoNumericExpr,
xmax: IntoNumericExpr,
ymax: IntoNumericExpr,
) -> GeoSeries
polars_st.GeoSeriesNameSpace.concave_hull #
polars_st.GeoSeriesNameSpace.segmentize #
segmentize(max_segment_length: IntoNumericExpr) -> GeoSeries
polars_st.GeoSeriesNameSpace.remove_repeated_points #
remove_repeated_points(tolerance: IntoNumericExpr = 0.0) -> GeoSeries
polars_st.GeoSeriesNameSpace.simplify #
simplify(
tolerance: IntoNumericExpr, preserve_topology: bool = True
) -> GeoSeries
polars_st.GeoSeriesNameSpace.force_3d #
force_3d(z: IntoNumericExpr = 0.0) -> GeoSeries
polars_st.GeoSeriesNameSpace.snap #
snap(other: IntoGeoExprColumn, tolerance: IntoNumericExpr) -> GeoSeries
polars_st.GeoSeriesNameSpace.shortest_line #
shortest_line(other: IntoGeoExprColumn) -> GeoSeries
polars_st.GeoSeriesNameSpace.affine_transform #
affine_transform(matrix: IntoExprColumn | Sequence[float]) -> GeoSeries
polars_st.GeoSeriesNameSpace.translate #
translate(
x: IntoNumericExpr = 0.0, y: IntoNumericExpr = 0.0, z: IntoNumericExpr = 0.0
) -> GeoSeries
polars_st.GeoSeriesNameSpace.rotate #
rotate(
angle: IntoNumericExpr,
origin: Literal["center", "centroid"] | Sequence[float] = "center",
) -> GeoSeries
polars_st.GeoSeriesNameSpace.scale #
scale(
x: IntoNumericExpr = 1.0,
y: IntoNumericExpr = 1.0,
z: IntoNumericExpr = 1.0,
origin: Literal["center", "centroid"] | Sequence[float] = "center",
) -> GeoSeries
polars_st.GeoSeriesNameSpace.skew #
skew(
x: IntoNumericExpr = 0.0,
y: IntoNumericExpr = 0.0,
z: IntoNumericExpr = 0.0,
origin: Literal["center", "centroid"] | Sequence[float] = "center",
) -> GeoSeries
polars_st.GeoSeriesNameSpace.interpolate #
interpolate(distance: IntoNumericExpr, normalized: bool = False) -> GeoSeries
polars_st.GeoSeriesNameSpace.project #
project(other: IntoGeoExprColumn, normalized: bool = False) -> Series
polars_st.GeoSeriesNameSpace.line_merge #
polars_st.GeoSeriesNameSpace.shared_paths #
shared_paths(other: IntoGeoExprColumn) -> GeoSeries
polars_st.GeoSeriesNameSpace.total_bounds #
polars_st.GeoSeriesNameSpace.union_all #
polars_st.GeoSeriesNameSpace.intersection_all #
polars_st.GeoSeriesNameSpace.difference_all #
polars_st.GeoSeriesNameSpace.symmetric_difference_all #
polars_st.GeoSeriesNameSpace.voronoi_polygons #
polars_st.GeoSeriesNameSpace.delaunay_triangles #
polars_st.GeoSeriesNameSpace.plot #
plot(**kwargs: Unpack[MarkConfigKwds]) -> Chart