MultiPolygon
Bases: Spatial
Represents a collection of polygons.
Follows the GeoJSON specification (RFC 7946).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
List[List[List[Tuple[float, float]]]]
|
A list of polygons. |
required |
Attributes:
Name | Type | Description |
---|---|---|
area |
|
|
polygons |
|
Examples:
>>> MultiPolygon(
... [
... [
... [(0,0), (0,1), (1,1), (0,0)]
... ],
... [
... [(0,0), (0,1), (1,1), (0,0)],
... [(0.1, 0.1), (0.1, 0.2), (0.2, 0.2), (0.1, 0.1)],
... [(0.6, 0.6), (0.6, 0.7), (0.7, 0.7), (0.6, 0.6)],
... ],
... ]
... )
Source code in valor/schemas/symbolic/types.py
1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 |
|
Attributes
valor.schemas.MultiPolygon.area
property
Symbolic representation of area.
Functions
valor.schemas.MultiPolygon.decode_value(value)
classmethod
Decode object from JSON compatible dictionary.
Source code in valor/schemas/symbolic/types.py
valor.schemas.MultiPolygon.from_polygons(polygons)
classmethod
Converts a list of Polygon instances to a MultiPolygon.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
polygons
|
List[Polygon]
|
A list of Polygon instances. |
required |
Returns:
Type | Description |
---|---|
MultiPolygon
|
A MultiPolygon instance. |
Source code in valor/schemas/symbolic/types.py
valor.schemas.MultiPolygon.to_polygons()
Converts multipolygon to a list of Polygon instances.
Returns:
Type | Description |
---|---|
List[Polygon]
|
|