Files
RadioPropagationApi/api/app/models/common.py
T
2026-06-23 13:57:33 +03:00

41 lines
815 B
Python

from typing import Any, Literal
from pydantic import BaseModel, Field
class Point(BaseModel):
lat: float = Field(ge=-90, le=90)
lon: float = Field(ge=-180, le=180)
class AntennaPoint(Point):
height_agl: float = Field(ge=0)
class TxPoint(AntennaPoint):
power_dbm: float | None = None
gain_dbi: float | None = None
frequency_mhz: float | None = Field(default=None, gt=0)
class RxPoint(AntennaPoint):
gain_dbi: float | None = None
sensitivity_dbm: float | None = None
GeoJSON = dict[str, Any]
SurfaceKind = Literal["dtm", "dsm"]
OutputFormat = Literal["geotiff", "png", "geojson"]
class ApiError(BaseModel):
code: str
detail: str
class DataSources(BaseModel):
dem: bool = False
buildings: bool = False
landcover: bool = False
canopy: bool = False