spatialdata.models.ShapesModel#
- class spatialdata.models.ShapesModel#
Attributes table#
Methods table#
|
Parse shapes data. |
|
Validate data. |
Attributes#
- ShapesModel.ATTRS_KEY = 'spatialdata_attrs'#
- ShapesModel.GEOMETRY_KEY = 'geometry'#
- ShapesModel.GEOS_KEY = 'geos'#
- ShapesModel.NAME_KEY = 'name'#
- ShapesModel.RADIUS_KEY = 'radius'#
- ShapesModel.TRANSFORM_KEY = 'transform'#
- ShapesModel.TYPE_KEY = 'type'#
Methods#
- ShapesModel.parse(data, **kwargs)#
Parse shapes data.
- Parameters:
data (
Any
) –Data to parse:
If
numpy.ndarray
, it assumes the shapes are parsed as ragged arrays, in case of (Multi)`Polygons`. Therefore additional argumentsoffsets
andgeometry
must be providedif
Path
orstr
, it’s read as a GeoJSON file.If
geopandas.GeoDataFrame
, it’s validated.
geometry –
Geometry type of the shapes. The following geometries are supported:
0:
Circles
3:
Polygon
6:
MultiPolygon
offsets – In the case of (Multi)`Polygons` shapes, the offsets of the polygons must be provided.
radius – Size of the
Circles
. It must be provided if the shapes areCircles
.index – Index of the shapes, must be of type
str
. If None, it’s generated automatically.transform – Transform of points.
kwargs (
Any
) – Additional arguments for GeoJSON reader.
- Return type:
- Returns:
- classmethod ShapesModel.validate(data)#
Validate data.
- Parameters:
data (
GeoDataFrame
) –geopandas.GeoDataFrame
to validate.- Return type:
None
- Returns:
: None