<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>Sounds easy....any chance you could write a tutorial using simple examples we could build on?</span></div><div><span><br></span></div><div><span>yours</span></div><div><span><br></span></div><div><span>Rob</span></div><div><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">Von:</span></b> Adam Eskreis <aeskreis@gmail.com><br><b><span style="font-weight: bold;">An:</span></b> Nicholas Efremov-Kendall <n.e.kendall@gmail.com><br><b><span style="font-weight: bold;">Cc:</span></b> openlayers-users@lists.osgeo.org<br><b><span style="font-weight: bold;">Gesendet:</span></b> 19:31 Dienstag, 15.November 2011 <br><b><span
style="font-weight: bold;">Betreff:</span></b> Re: [OpenLayers-Users] Open layers with postgis<br></font><br><div id="yiv1983370028">Hello Aditya,<br><br>I do what you are wanting to do nearly every day at my job. Here are a few tips to help you get started:<br><br>1. The first thing you need to do is set up a connection to your PostgreSQL database. Once this is complete, we can get started<br>
2. Next you are going to want to retrieve your data and pass it to the frontend. Assuming you already know how to do a spatial query, I would pull whatever data you want from the database, parse it into an array and echo it out using json.<br>
3. Once you have your json on the frontend, you just loop through the array and plot the data as you need.<br>4. The geo-data will come back from PostGIS as either Well Known Binary, or Well Known Text, depending on how you chose to retrieve it. WKB is faster, but is harder to parse, and WKT has built in support in OpenLayers. (have a look at the OpenLayers.Geometry.fromWKT function). I recommend pulling in the data as WKT for starting out, and as you get more familiar you can work on writing a WKB parser.<br>
5. If you need help using spatial queries, I would consult the PostGIS guide before continuing wiht anything, however the main functions I would recommen dlooking up are:<br>distance<br>within<br>contains<br>intersects<br>
astext<br><br>These functions will encompass most spatial queries you need to execute.<br><br>Hope this helps,<br>-Adam<br><br><br><br><br><div class="yiv1983370028gmail_quote">On Tue, Nov 15, 2011 at 8:08 AM, Nicholas Efremov-Kendall <span dir="ltr"><<a rel="nofollow" ymailto="mailto:n.e.kendall@gmail.com" target="_blank" href="mailto:n.e.kendall@gmail.com">n.e.kendall@gmail.com</a>></span> wrote:<br>
<blockquote class="yiv1983370028gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I have an ajax app the querries mysql and returns the results as GML. If you like, I can share the code with you,<div class="yiv1983370028HOEnZb">
<div class="yiv1983370028h5"><br><br><div class="yiv1983370028gmail_quote">On Tue, Nov 15, 2011 at 2:15 AM, adams <span dir="ltr"><<a rel="nofollow" ymailto="mailto:adams@terrestris.de" target="_blank" href="mailto:adams@terrestris.de">adams@terrestris.de</a>></span> wrote:<br>
<blockquote class="yiv1983370028gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Oh sorry,<br>
I apologize, the correct URL is:<br>
<br>
<a rel="nofollow" target="_blank" href="http://www.openlayers-buch.de/beispiele.php">http://www.openlayers-buch.de/beispiele.php</a><br>
<br>
<br>
(@Bart 403 only for you - today because of the football match, thanks<br>
for the hint)<br>
<br>
Regards, Till<br>
<br>
On 15.11.2011 09:08, Bart van den Eijnden (OSGIS) wrote:<br>
> Hey Till,<br>
><br>
> that URL gives a 403 forbidden.<br>
><br>
> Best regards,<br>
> Bart<br>
<div><div>><br>
>> Dear Aditya,<br>
>><br>
>> there is postgis console, which directly displays queries in OL - this<br>
>> is a tool my colleague made for a german OL manual.<br>
>><br>
>> See the stuff here:<br>
>> <a rel="nofollow" target="_blank" href="http://www.openlayers-buch.de/beispiele/">http://www.openlayers-buch.de/beispiele/</a><br>
>><br>
>> go to chapter 9 (in germany only, sorry).<br>
>><br>
>> You may also download the code from this page.<br>
>><br>
>> Regards, Till<br>
>><br>
>><br>
>> On 15.11.2011 08:54, Aditya Kumar wrote:<br>
>>> Dear USers,<br>
>>> I want to display the result of some queries from postgis using<br>
>>> php.Can<br>
>>> you suggest me some documentation for this so that I can go through them<br>
>>> and<br>
>>> make my application?<br>
>>><br>
>>><br>
>>> Aditya Kumr<br>
>>><br>
>>> --<br>
>>> View this message in context:<br>
>>> <a rel="nofollow" target="_blank" href="http://osgeo-org.1803224.n2.nabble.com/Open-layers-with-postgis-tp6995410p6995410.html">http://osgeo-org.1803224.n2.nabble.com/Open-layers-with-postgis-tp6995410p6995410.html</a><br>
>>> Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
>>> _______________________________________________<br>
>>> Users mailing list<br>
>>> <a rel="nofollow" ymailto="mailto:Users@lists.osgeo.org" target="_blank" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
>>> <a rel="nofollow" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
>>><br>
>><br>
>> --<br>
>><br>
>><br>
>> --> GO Mobile - jetzt WebGIS auch auf Smartphones <--<br>
>> ! Achtung - terrestris hat eine neue Adresse !<br>
>><br>
>> ---------------------------------------------------------<br>
>> terrestris GmbH & Co. KG<br>
>> Puetzchens Chaussee 56<br>
>> 53227 Bonn<br>
>> Germany<br>
>><br>
>> Till Adams<br>
>> Geschaeftsfuehrung<br>
>><br>
>> Tel: <a rel="nofollow">+49 (0)228 / 962 899-52</a><br>
>> Mobile: <a rel="nofollow">+49 (0)151 / 25394429</a><br>
>> Fax: <a rel="nofollow">+49 (0)228 / 962 899-57</a><br>
>><br>
>> <a rel="nofollow" ymailto="mailto:adams@terrestris.de" target="_blank" href="mailto:adams@terrestris.de">adams@terrestris.de</a><br>
>> <a rel="nofollow" target="_blank" href="http://www.terrestris.de">http://www.terrestris.de</a><br>
>> Amtsgericht Bonn, HRA 6835<br>
>> ---------------------------------------------------------<br>
>><br>
>> Komplementaerin:<br>
>><br>
>> terrestris Verwaltungs GmbH<br>
>><br>
>> vertreten durch:<br>
>> Hinrich Paulsen, Till Adams<br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a rel="nofollow" ymailto="mailto:Users@lists.osgeo.org" target="_blank" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
>> <a rel="nofollow" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
>><br>
><br>
><br>
<br>
--<br>
<br>
<br>
--> GO Mobile - jetzt WebGIS auch auf Smartphones <--<br>
! Achtung - terrestris hat eine neue Adresse !<br>
<br>
---------------------------------------------------------<br>
terrestris GmbH & Co. KG<br>
Puetzchens Chaussee 56<br>
53227 Bonn<br>
Germany<br>
<br>
Till Adams<br>
Geschaeftsfuehrung<br>
<br>
Tel: <a rel="nofollow">+49 (0)228 / 962 899-52</a><br>
Mobile: <a rel="nofollow">+49 (0)151 / 25394429</a><br>
Fax: <a rel="nofollow">+49 (0)228 / 962 899-57</a><br>
<br>
<a rel="nofollow" ymailto="mailto:adams@terrestris.de" target="_blank" href="mailto:adams@terrestris.de">adams@terrestris.de</a><br>
<a rel="nofollow" target="_blank" href="http://www.terrestris.de">http://www.terrestris.de</a><br>
Amtsgericht Bonn, HRA 6835<br>
---------------------------------------------------------<br>
<br>
Komplementaerin:<br>
<br>
terrestris Verwaltungs GmbH<br>
<br>
vertreten durch:<br>
Hinrich Paulsen, Till Adams<br>
_______________________________________________<br>
Users mailing list<br>
<a rel="nofollow" ymailto="mailto:Users@lists.osgeo.org" target="_blank" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</div></div></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Users mailing list<br>
<a rel="nofollow" ymailto="mailto:Users@lists.osgeo.org" target="_blank" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br>
</div><br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@lists.osgeo.org" 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><br><br></div></div></div></body></html>