On 03/25/2010 04:03 PM, Mapmaker wrote:
You can query PostGIS and use a PHP script to return the results as KML, GML,
GeoJson- and add that layer directly in OpenLayers.
Thanks.
Just to complete the thread, I'm doing the following in php to dynamically create each GML layer from PostGIS views as needed:

    $ogrcmd =   "/usr/local/bin/ogr2ogr ";
    $ogrcmd.=   " -f \"GML\" -a_srs \"EPSG:2039\" -overwrite ";
    $ogrcmd.=   $gml_path." PG:\"user=xxxxxxx dbname=xxxxxxx\" ";
    $ogrcmd.=   " ".$event_code;
    system($ogrcmd, $resp);

( $gml_path and $event_code are php vars created within the function)
Then in I create the openlayers vector like:
echo "var cur_data = new OpenLayers.Layer.GML(\"Current Rain Data\",\"".$url_path."\",";
....

--
Micha Silver
http://www.surfaces.co.il/
Arava Development Co.  +972-52-3665918

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to