I also use OGR to export, here is an example with PHP

$query = sprintf('select * from %s%s as a;',$schema,$layerName);
$result = pg_query($dbconn, $query);

$ogr2ogr = 'CALL D:\\ms4w\\tools\\gdal-ogr\\ogr2ogr.exe';
//where the file goes
$stock = 'd:\\ms4w\\Apache\\htdocs\\tmp\\'; 
$shellcommand = $ogr2ogr.' -f KML '. $stock . 'data_'. $layerName . '.kml 
PG:" host=xxxx dbname=xx  user=xx password=xxx" -sql "'.$query.'"';
$shellresult = shell_exec($shellcommand); 


steve

Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction des risques biologiques, environnementaux et occupationnels
Institut national de santé publique du Québec
945, avenue Wolfe
Québec, Qc G1V 5B3 
Tél.: (418) 650-5115 #5281
Fax.: (418) 654-3144
[email protected]
http://www.inspq.qc.ca
 
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to