Ignore 0,0 fixes in updating KML too

This commit is contained in:
Samuel Sloniker 2024-07-28 13:02:41 -07:00
parent 80e8274f7c
commit 6f67beed86

View File

@ -28,8 +28,8 @@ def main(port, intercom):
lon = parsed_data.lon lon = parsed_data.lon
time = parsed_data.time time = parsed_data.time
date = parsed_data.date date = parsed_data.date
navpoint.content.content = f"""<?xml version='1.0' encoding='us-ascii'?><kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2"><Document><Style id="icon"><IconStyle><Icon><href>http://127.0.0.1:8888/marker.png</href></Icon></IconStyle></Style><name>Navpoint</name><open>1</open><Placemark><name>Position</name><styleUrl>#icon</styleUrl><Point><coordinates>{lon},{lat},0</coordinates></Point><description>{date} {time} UTC</description></Placemark></Document></kml>"""
if lat or lon: # ignore 0, 0 fixes if lat or lon: # ignore 0, 0 fixes
navpoint.content.content = f"""<?xml version='1.0' encoding='us-ascii'?><kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2"><Document><Style id="icon"><IconStyle><Icon><href>http://127.0.0.1:8888/marker.png</href></Icon></IconStyle></Style><name>Navpoint</name><open>1</open><Placemark><name>Position</name><styleUrl>#icon</styleUrl><Point><coordinates>{lon},{lat},0</coordinates></Point><description>{date} {time} UTC</description></Placemark></Document></kml>"""
intercom.put( intercom.put(
"LocationUpdate", "LocationUpdate",
{ {