From bd5acc3f5e351bfb321a2cc8ee09c16d2a99d99f Mon Sep 17 00:00:00 2001 From: kim Date: Fri, 22 Mar 2024 12:53:17 -0800 Subject: [PATCH] fixes kml output failure on non-spatial results --- asf_search/export/kml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asf_search/export/kml.py b/asf_search/export/kml.py index 57f6d638..1486a1f8 100644 --- a/asf_search/export/kml.py +++ b/asf_search/export/kml.py @@ -126,7 +126,9 @@ def getItem(self, p): outerBondaryIs.append(linearRing) coordinates = ETree.Element('coordinates') - coordinates.text = '\n' + (14 * ' ') + ('\n' + (14 * ' ')).join([f"{c['Longitude']},{c['Latitude']},2000" for c in p['shape']]) + '\n' + (14 * ' ') + + if p.get('shape') is not None: + coordinates.text = '\n' + (14 * ' ') + ('\n' + (14 * ' ')).join([f"{c['Longitude']},{c['Latitude']},2000" for c in p.get('shape')]) + '\n' + (14 * ' ') linearRing.append(coordinates) self.indent(placemark, 3)