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", "xy"] | None
) = None
)
Bases: Series
Create a new GeoSeries.
A GeoSeries is a regular
polars.Series
with type annotations added for the st
namespace. It contains geometries in binary
EWKB format.
You can create a GeoSeries from a list of 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. It is also possible to create
a GeoSeries of points from a Polars
Struct
with fields
"x", "y" (, "z").
See pl.Series
for parameters documentation.
Examples:
>>> gs = st.GeoSeries([
... "POINT(0 0)",
... "POINT(1 2)",
... ])
>>> gs2 = st.GeoSeries(pl.struct(
... x=pl.Series([0, 1]),
... y=pl.Series([0, 2]),
... eager=True,
... ))
>>> gs.equals(gs2)
True
>>> gs.dtype
Binary
>>> 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] = 2) -> Series
polars_st.GeoSeriesNameSpace.apply_coordinates #
apply_coordinates(transform: CoordinatesApply) -> GeoSeries
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: IntoDecimalExpr,
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 #
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: IntoDecimalExpr,
quad_segs: int = 8,
join_style: Literal["round", "mitre", "bevel"] = "round",
mitre_limit: float = 5.0,
) -> GeoSeries
polars_st.GeoSeriesNameSpace.clip_by_rect #
polars_st.GeoSeriesNameSpace.concave_hull #
polars_st.GeoSeriesNameSpace.segmentize #
segmentize(max_segment_length: IntoDecimalExpr) -> GeoSeries
polars_st.GeoSeriesNameSpace.remove_repeated_points #
remove_repeated_points(tolerance: IntoDecimalExpr = 0.0) -> GeoSeries
polars_st.GeoSeriesNameSpace.simplify #
simplify(
tolerance: IntoDecimalExpr, preserve_topology: bool = True
) -> GeoSeries
polars_st.GeoSeriesNameSpace.snap #
snap(other: IntoGeoExprColumn, tolerance: IntoDecimalExpr) -> 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: IntoDecimalExpr = 0.0, y: IntoDecimalExpr = 0.0, z: IntoDecimalExpr = 0.0
) -> GeoSeries
polars_st.GeoSeriesNameSpace.rotate #
rotate(
angle: IntoDecimalExpr,
origin: (
Literal["center", "centroid"] | Sequence[float] | Expr | Series
) = "center",
) -> GeoSeries
polars_st.GeoSeriesNameSpace.scale #
scale(
x: IntoDecimalExpr = 1.0,
y: IntoDecimalExpr = 1.0,
z: IntoDecimalExpr = 1.0,
origin: (
Literal["center", "centroid"] | Sequence[float] | Expr | Series
) = "center",
) -> GeoSeries
polars_st.GeoSeriesNameSpace.interpolate #
interpolate(distance: IntoDecimalExpr, normalized: bool = False) -> GeoSeries
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[EncodeKwds]) -> Chart