Shape
siapy.entities.shapes.shape
¶
ShapeGeometryEnum
¶
Bases: Enum
Geometry Types: - Point: Single coordinate point (x,y) - LineString: Series of connected points forming a line - Polygon: Closed shape with interior area - MultiPoint: Collection of independent points - MultiLineString: Collection of independent lines - MultiPolygon: Collection of independent polygons
Shape
dataclass
¶
Shape(
label: str = "",
geometry: Optional[BaseGeometry] = None,
geo_dataframe: Optional[GeoDataFrame] = None,
)
Unified shape class that can be created from shapefiles or programmatically.
This class uses GeoDataFrame as its primary internal representation. Direct initialization is possible but using class methods is recommended.
Source code in siapy/entities/shapes/shape.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
open_shapefile
classmethod
¶
Source code in siapy/entities/shapes/shape.py
82 83 84 85 86 87 88 89 90 91 |
|
from_geometry
classmethod
¶
Source code in siapy/entities/shapes/shape.py
93 94 95 96 97 98 99 100 101 |
|
from_geodataframe
classmethod
¶
Source code in siapy/entities/shapes/shape.py
103 104 105 106 107 108 109 110 111 |
|
from_point
classmethod
¶
Source code in siapy/entities/shapes/shape.py
113 114 115 |
|
from_multipoint
classmethod
¶
from_multipoint(
points: Pixels | DataFrame | Iterable[CoordinateInput],
label: str = "",
) -> Shape
Source code in siapy/entities/shapes/shape.py
117 118 119 120 121 122 123 |
|
from_line
classmethod
¶
from_line(
pixels: Pixels | DataFrame | Iterable[CoordinateInput],
label: str = "",
) -> Shape
Source code in siapy/entities/shapes/shape.py
125 126 127 128 129 130 131 |
|
from_multiline
classmethod
¶
from_multiline(
line_segments: list[
Pixels | DataFrame | Iterable[CoordinateInput]
],
label: str = "",
) -> Shape
Source code in siapy/entities/shapes/shape.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
from_polygon
classmethod
¶
from_polygon(
exterior: Pixels
| DataFrame
| Iterable[CoordinateInput],
holes: Optional[
list[Pixels | DataFrame | Iterable[CoordinateInput]]
] = None,
label: str = "",
) -> Shape
Source code in siapy/entities/shapes/shape.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
|
from_multipolygon
classmethod
¶
from_multipolygon(
polygons: list[
Pixels | DataFrame | Iterable[CoordinateInput]
],
label: str = "",
) -> Shape
Source code in siapy/entities/shapes/shape.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
from_rectangle
classmethod
¶
Source code in siapy/entities/shapes/shape.py
198 199 200 201 |
|
from_circle
classmethod
¶
from_circle(
center: PixelCoordinate, radius: float, label: str = ""
) -> Shape
Source code in siapy/entities/shapes/shape.py
203 204 205 206 207 |
|
copy
¶
copy() -> Shape
Create a deep copy of the Shape instance.
Source code in siapy/entities/shapes/shape.py
289 290 291 292 |
|
buffer
¶
Source code in siapy/entities/shapes/shape.py
294 295 296 297 298 |
|
intersection
¶
Source code in siapy/entities/shapes/shape.py
300 301 302 303 304 |
|
union
¶
Source code in siapy/entities/shapes/shape.py
306 307 308 309 310 |
|
to_file
¶
Source code in siapy/entities/shapes/shape.py
312 313 |
|