MCPcopy
hub / github.com/django/django / compress_kml

Function compress_kml

django/contrib/gis/shortcuts.py:15–21  ·  view source on GitHub ↗

Return compressed KMZ from the given KML string.

(kml)

Source from the content-addressed store, hash-verified

13
14
15def 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
24def render_to_kml(*args, **kwargs):

Callers 1

render_to_kmzFunction · 0.85

Calls 3

seekMethod · 0.80
encodeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected