Return compressed KMZ from the given KML string.
(kml)
| 13 | |
| 14 | |
| 15 | def compress_kml(kml): |
| 16 | "Return compressed KMZ from the given KML string." |
| 17 | kmz = BytesIO() |
| 18 | with zipfile.ZipFile(kmz, "a", zipfile.ZIP_DEFLATED) as zf: |
| 19 | zf.writestr("doc.kml", kml.encode(settings.DEFAULT_CHARSET)) |
| 20 | kmz.seek(0) |
| 21 | return kmz.read() |
| 22 | |
| 23 | |
| 24 | def render_to_kml(*args, **kwargs): |
no test coverage detected