/
geography.py
40 lines (27 loc) · 960 Bytes
/
geography.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from pydantic import BaseModel
from typing import List, Optional, Tuple
from vortexasdk.api.shared_types import (
ID,
EntityWithSingleLayerAndProbability,
IDLayer,
IDNameLayer,
Node,
)
Position = Tuple[float, float]
class BoundingBox(BaseModel):
"""Polygon with list of bounding lon lat coords."""
type: Optional[str] = None
coordinates: Optional[List[Position]] = None
class Geography(Node):
"""Represent a Geography reference record returned by the API."""
id: ID
name: Optional[str] = None
layer: Optional[List[str]] = None
exclusion_rule: Optional[List[IDNameLayer]] = None
hierarchy: Optional[List[IDLayer]] = None
pos: Optional[List[str]] = None
class GeographyEntity(EntityWithSingleLayerAndProbability):
"""
Represents a hierarchy tree of locational data.
[Geography Entities Further Documentation](https://docs.vortexa.com/reference/intro-geography-entries)
"""