How to output KML by GAE

Posted by Niklas R on Stack Overflow See other posts from Stack Overflow or by Niklas R
Published on 2011-01-07T04:49:14Z Indexed on 2011/01/07 4:53 UTC
Read the original article Hit count: 322

Hi I use KML for a google map where entities have a geopt.db coordinate and soft memory limit was exceeded with 213.465 MB after servicing 1 requests total. The log says /list.kml 200 13130ms 10211cpu_ms 4238api_cpu_ms The file list.kml which outputs about 455,7 KB is a template as follows

<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://
www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2"
xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://
www.w3.org/2005/Atom">
<Document>{% for a in list %}
<Placemark>
<name>
</name>
<description>
<![CDATA[<a href="http://{{host}}/{{a.key.id}}"> {{ a.title }} </a>
<br/>{{a.text}}]]>    
</description>
<Style>
<IconStyle>
<Icon>
<href>
http://www.google.com/intl/en_us/mapfiles/ms/icons/green-dot.png
</href>
</Icon>
</IconStyle>
</Style>
<Point>
<coordinates>
{{a.geopt.lon|floatformat:2}},{{a.geopt.lat|floatformat:2}}
</coordinates>
</Point>
</Placemark>
{% endfor %}
</Document>
</kml>

Is there a memory leak in the template or the python that passes the list variable? Can I improve using other template engine or other framework than default? Is kmz compression a good idea in this case? Thanks in advance for any suggestion where or how to change the code.

© Stack Overflow or respective owner

Related posts about google-app-engine

Related posts about google-maps