support MultiPolygon geojson in geometry schemas (Fixes C3NAV-37C3-1, Fixes C3NAV-37C3-12)
This commit is contained in:
parent
15dc4c0023
commit
9806472083
1 changed files with 16 additions and 1 deletions
|
@ -61,6 +61,19 @@ class PolygonSchema(BaseSchema):
|
||||||
title = "GeoJSON Polygon"
|
title = "GeoJSON Polygon"
|
||||||
|
|
||||||
|
|
||||||
|
class MultiPolygonSchema(BaseSchema):
|
||||||
|
"""
|
||||||
|
A GeoJSON MultiPolygon
|
||||||
|
"""
|
||||||
|
type: Literal["MultiPolygon"]
|
||||||
|
coordinates: list[list[list[tuple[float, float]]]] = APIField(
|
||||||
|
example=[[[[1.5, 1.5], [1.5, 2.5], [2.5, 2.5], [2.5, 2.5]]]]
|
||||||
|
)
|
||||||
|
|
||||||
|
class Config(Schema.Config):
|
||||||
|
title = "GeoJSON Polygon"
|
||||||
|
|
||||||
|
|
||||||
class LineStringSchema(BaseSchema):
|
class LineStringSchema(BaseSchema):
|
||||||
"""
|
"""
|
||||||
A GeoJSON LineString
|
A GeoJSON LineString
|
||||||
|
@ -104,7 +117,9 @@ GeometrySchema = Annotated[
|
||||||
Union[
|
Union[
|
||||||
PolygonSchema,
|
PolygonSchema,
|
||||||
LineStringSchema,
|
LineStringSchema,
|
||||||
PointSchema,],
|
PointSchema,
|
||||||
|
MultiPolygonSchema,
|
||||||
|
],
|
||||||
Discriminator("type"),
|
Discriminator("type"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue