Another way would be to use the postgis extension to postgresql to store spatial tables, which can then be exported to GEOJSON format.<br><br><br><a href="http://www.postgis.org/documentation/manual-1.5/ST_AsGeoJSON.html">http://www.postgis.org/documentation/manual-1.5/ST_AsGeoJSON.html</a><br>
<br><br><br><div class="gmail_quote">On Mon, Oct 10, 2011 at 11:36 PM, Gabriele Seitz <span dir="ltr">&lt;<a href="mailto:ml-seitz@web.de">ml-seitz@web.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I never tried ist myself before, but there is a GeoJSON Example at<br>
<a href="http://www.openlayers.org/dev/examples/geojson.html" target="_blank">http://www.openlayers.org/dev/examples/geojson.html</a><br>
<br>
Basically yuo should use  var geojson_format = new<br>
OpenLayers.Format.GeoJSON();<br>
<br>
Hope this helps.<br>
<br>
Gabriele<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/how-to-add-php-postgresql-query-result-as-Geojson-layer-to-openlayers-tp6876808p6879775.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/how-to-add-php-postgresql-query-result-as-Geojson-layer-to-openlayers-tp6876808p6879775.html</a><br>

Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Vishal K. Mehta, PhD<br>Scientist<br>Stockholm Environment Institute - US<br>133 D St Suite F<br>Davis CA 95616<br><a href="http://www.sei-us.org">www.sei-us.org</a><br>