[postgis-users] AsKML() how to create kml from postgis data

John Smith jayzee.smith at gmail.com
Fri Sep 14 08:25:17 PDT 2007


as_kml()?! there's another askml() in line with asgml(). why this
alias/name change/confusion?

anyway how does it really work? getting a "Must contain
'geometry_column from table_name' or 'geom from (subselect) as foo'
(couldnt find ' from ')". what do i do after passing bbox=... and
type=kml to export script? the sql doesn't go inside .map, right? can
some share a detailed use/script? not much in
http://postgis.refractions.net/docs/postgis.pdf

btw super example at
http://casoilresource.lawr.ucdavis.edu/ka-map/htdocs/?map=casoil&cps=-2012507.9410234897,-132997.150403761,500000&layers=__base__
although i didn't quite get this part:
1. select geometry overlapping the bounding box defined by the current
viewport in AEA coordinates, using the PostGIS spatial indexing system
2. compute the intersection between the boinding box and the
overlapping polygons
3. compute the centroids of the new geometry
4. convert the polygon geometry to KML
5. convert the centroid geometry to KML
6. return resulting text
cheers, jzs

On 9/14/07, Jose Gomez-Dans <jgomezdans at gmail.com> wrote:
> Hi Maciej,
> I sent you an e-mail, but your spam protection system wouldn't allow
> the message to go through.  If you have another address, I'll resend
> it to you :)
>
> On 9/14/07, Maciej Skorczewski <maciej.skorczewski at procad.pl> wrote:
> > how sql should looks like?
>
> Simply (and this is already quite advanced: you can use simplify() to
> reduce the number of points in your vector data. Ours are very
> detailed, and we don't want that on our KML files):
>
> SELECT AS_KML(SIMPLIFY(the_geom,100)) from MY_TABLE;
>
> > Question about Python class...i am not python programer can you
> > describe my how i can use it?
>
> You just write a small python program to use it. You should be able to
> do the same with PHP.
>
> Cheers,
> José



More information about the postgis-users mailing list