capturegraph.data.typed_json.handlers.solar
#
SolarHandler
#
Bases: TypeHandler
TypeHandler for CaptureGraph SolarPosition objects.
Serializes Location to lat/lon/alt format compatible with iOS PLocation.
Source code in capturegraph-lib/capturegraph/data/typed_json/handlers/solar.py
decodable_schema()
#
Return schema: expects latitude, longitude, altitude keys.
decode(obj)
#
Decode JSON dict to Location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Dict[str, Any]
|
Dict with 'latitude', 'longitude', 'altitude' keys. |
required |
Returns:
| Type | Description |
|---|---|
Any | None
|
Location instance, or None if schema doesn't match. |
Source code in capturegraph-lib/capturegraph/data/typed_json/handlers/solar.py
encodable_types()
#
encode(obj)
#
Encode Location to JSON dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Any
|
Location instance to encode. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | None
|
Dict with latitude/longitude/altitude keys, or None if not a Location. |