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

Shane Spencer shane at bogomip.com
Fri Sep 14 19:01:31 PDT 2007


Thats so cool it hurts.. I love offloading processing to the big bad server
while the little wimpy sql clients request the data.  Good find!

On 9/14/07, Kevin Neufeld <kneufeld at refractions.net> wrote:
>
> Absolutely.
>
> See attached, a simple plpgsql function that adds header info around the
> current askml function.
>
> I do this in psql:
> -- Set output to unaligned
> \a
>
> -- Show only tuples
> \t
>
> -- Dump query to a file
> \o my_kml_file.kml
>
> -- Run your query
> SELECT askml('my_line', 'description', 'SRID=3005;LINESTRING( 1190000
> 390000, 1200000 390000, 1200000 380000, 1190000 380000, 1190000 390000
> )'::geometry);
>
> -- Flush output your file and close the output stream
> \o
>
> Loading this file in Google Earth will draw a box around Victoria, BC.
>
> I often collect() geometries from a table and pass those into this
> function:
> SELECT askml('my_title', 'description', collect(the_geom)) FROM my_line
> table WHERE ....
>
> Cheers,
> Kevin
>
> -------------
> Kevin Neufeld
> Software Developer
> Refractions Research Inc.
> 300-1207 Douglas St.
> Victoria, B.C., V8W 2E7
>
> Phone: (250) 383-3022
> Email: kneufeld at refractions.net
>
>
>
> Maciej Skorczewski wrote:
> > hi all!
> >
> >
> > How should i use AsKML() function to create KML files (w try show
> > postgis data in google maps nad google earth)
> >
> > It is posible?
> >
> >
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070914/c6860efd/attachment.html>


More information about the postgis-users mailing list