[postgis-users] KML Export

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Wed Jul 15 08:47:48 PDT 2009


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
steve.toutant at inspq.qc.ca
http://www.inspq.qc.ca
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090715/4770227a/attachment.html>


More information about the postgis-users mailing list