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

Maciej Skorczewski maciej.skorczewski at procad.pl
Sun Sep 16 23:53:49 PDT 2007


thx Kevin for replay!

  great help.

:)

maciek


Kevin Neufeld pisze:
> 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






More information about the postgis-users mailing list