In the last hour I've managed to export KML files using the following syntax after some simple mods (read mimic the name/description handling) to the KML export functions in OGR:

/Library/Frameworks/GDAL.framework/Programs/ogr2ogr \
-f KML activity.kml  \
PG:"host=localhost dbname=wadnr" \
-sql "select st_transform(st_centroid(boundary),4326), \
current_database() as name, \
now() as generated_when, \
effective_date || 'D' as TimeStamp \
from tmp_tbl limit 15000" \
-nlt POINT \
-nln activity

I'm not sure the best way to get this code back into the repos if anyone is interested (and I haven't bothered to fix the following):

ogr2ogr(25854) malloc: *** error for object 0xf01350: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
ogr2ogr(25854) malloc: *** error for object 0xf01360: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
ogr2ogr(25854) malloc: *** error for object 0xf01370: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

Warning 1: Multi-column primary key in 'stems' detected but not supported.

jeff-hamanns-macbook-pro:trunk hamannj$

but it does the job of adding the following tags/elements/whatever they're called to the file:

<TimeStamp><when>2002-05-18D</when></TimeStamp>

to each placemark, which is what I needed. I have a feeling I'll be hacking on this again in the next few days, so any advice for putting in other features would be helpful. Ultimately, I need to include both TimeStamps and TimeSpans for each entry (Placemark/Linestring/Polygon). Next stop, coloring the pins ;-)


Jeff.

begin:vcard
fn:Jeff Hamann
n:Hamann;Jeff
org:Forest Informatics
adr:;;PO Box 1421;Corvallis;Oregon;97339-1421;United States
email;internet:[email protected]
title:President
tel;work:15417542457
x-mozilla-html:FALSE
url:www.forestinformatics.com
version:2.1
end:vcard

_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to