mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-23 04:26:36 +00:00
initial structure implemented
docs -> _docs
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from pydantic import BaseModel, field_validator
|
||||
|
||||
|
||||
class GPSPoint(BaseModel):
|
||||
lat: float
|
||||
lon: float
|
||||
|
||||
@field_validator("lat")
|
||||
@classmethod
|
||||
def validate_lat(cls, v: float) -> float:
|
||||
if not -90 <= v <= 90:
|
||||
raise ValueError("Latitude must be between -90 and 90")
|
||||
return v
|
||||
|
||||
@field_validator("lon")
|
||||
@classmethod
|
||||
def validate_lon(cls, v: float) -> float:
|
||||
if not -180 <= v <= 180:
|
||||
raise ValueError("Longitude must be between -180 and 180")
|
||||
return v
|
||||
|
||||
Reference in New Issue
Block a user