I am learning now geodjango. I made basic web app with postgis database. With openlayers iam displaying basic wms map and I want to add other layers from my postgis database. I use render_to_kml function and then I visualize this kml with openlayers. The problem is that I can only display point layers instead of multipolygons...I tried to make another kml template bud I misunderstand it and there is no good documentation... I paste here my files ( view, template, urls) and please give me advice if you can,,,where I have mistake ( I think it will be something with KML templates but i dont know.)

this is my views.py

this is my html template

  1. this is my views.py

  2. this is my html template

  3. this is my urls.py this is my urls.py

This results into application with 3 layers (basic map and 2layers from my postgis database which are equivalent (both are point feature....Polygons feature is only copy of Point feature...Thats my problem))... Anyone has a solution for me?

  • Are the coordinates for the polygon data being parsed correctly? – danagerous Jan 20 '14 at 19:53

I found a solution. I made another kml template and also made a copy of base.kml template in same directory and saved as base2.kml... then rewrite my polygons.kml to be in base2.kml and it works for me, i displayed both layers, but KML it is very slow , and i am thinking about geoserver and publish it from postgis database as WMS, it would be faster and i put there funkcionality that poeple can download KML format if they want.....or anyone have better solution for faster rendering?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.