From 44d5afdc26ab487a7127f0e5b29d486d78625939 Mon Sep 17 00:00:00 2001 From: Alex-Lewandowski <37909088+Alex-Lewandowski@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:02:07 -0800 Subject: [PATCH] `save_kmz`: support data in UTM (#1210) * convert UTM coords to WGS84 in write_kmz_overlay * check for UTM_ZONE in metadata before converting bbox coords to wgs84 * undo extensive formatting * empty line at end of file * fix end of file --- src/mintpy/save_kmz.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mintpy/save_kmz.py b/src/mintpy/save_kmz.py index 4e78222b4..bada5d836 100644 --- a/src/mintpy/save_kmz.py +++ b/src/mintpy/save_kmz.py @@ -233,6 +233,10 @@ def write_kmz_overlay(data, meta, out_file, inps): """ south, north, west, east = ut.four_corners(meta) + # convert from UTM to WGS84 when necessary, as KML only natively supports WGS84 + if "UTM_ZONE" in meta.keys(): + north, east = ut.utm2latlon(meta, east, north) + south, west = ut.utm2latlon(meta, west, south) # 1. Make PNG file - Data print('plotting data ...')