parse NMEA coordinates from metadata
This commit is contained in:
parent
b142233d4e
commit
34065e455f
@ -92,7 +92,6 @@ class YsfMetaEnricher(Enricher):
|
|||||||
if key in meta:
|
if key in meta:
|
||||||
meta[key] = float(meta[key])
|
meta[key] = float(meta[key])
|
||||||
if "source" in meta and "lat" in meta and "lon" in meta:
|
if "source" in meta and "lat" in meta and "lon" in meta:
|
||||||
# TODO parsing the float values should probably happen earlier
|
|
||||||
loc = LatLngLocation(meta["lat"], meta["lon"])
|
loc = LatLngLocation(meta["lat"], meta["lon"])
|
||||||
Map.getSharedInstance().updateLocation(meta["source"], loc, "YSF", self.parser.getBand())
|
Map.getSharedInstance().updateLocation(meta["source"], loc, "YSF", self.parser.getBand())
|
||||||
return meta
|
return meta
|
||||||
@ -100,6 +99,12 @@ class YsfMetaEnricher(Enricher):
|
|||||||
|
|
||||||
class DStarEnricher(Enricher):
|
class DStarEnricher(Enricher):
|
||||||
def enrich(self, meta):
|
def enrich(self, meta):
|
||||||
|
for key in ["lat", "lon"]:
|
||||||
|
if key in meta:
|
||||||
|
meta[key] = float(meta[key])
|
||||||
|
if "ourcall" in meta and "lat" in meta and "lon" in meta:
|
||||||
|
loc = LatLngLocation(meta["lat"], meta["lon"])
|
||||||
|
Map.getSharedInstance().updateLocation(meta["ourcall"], loc, "D-Star", self.parser.getBand())
|
||||||
if "dprs" in meta:
|
if "dprs" in meta:
|
||||||
# we can send the DPRS stuff through our APRS parser to extract the information
|
# we can send the DPRS stuff through our APRS parser to extract the information
|
||||||
# TODO: only third-party parsing accepts this format right now
|
# TODO: only third-party parsing accepts this format right now
|
||||||
|
Loading…
Reference in New Issue
Block a user