<p>How about ST_AsText(geometry)?</p>
<div class="gmail_quote">Dne 10.10.2012 13:27 "Marky Mark" <<a href="mailto:markymark9705@yahoo.com">markymark9705@yahoo.com</a>> napsal(a):<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div></div><div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Hi,</span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">This is
the definition of a newbie question but how do I take a PostGIS-generated
geometry value such as
"0101000020346C0000F5A4B17560061841A3D4467F89992841" and convert it
to a latitide and longitude to plug into a Google Map (as below)? I've tried
using the following code in Postgres to extract lat & long:</span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">select ST_X(geo_location),ST_Y(geo_location)
from testdb.places</span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">SELECT
ST_X(geo_location::geometry), ST_Y(geo_location::geometry) FROM testdb.places;</span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">And these
both produce values 393624.114935472,806084.74858727 for the above geometry
value (I'd expect something like 57.1500,-2.1000)</span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">What
incredibly stupid thing am I not grasping here?</span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Many
thanks, Marko</span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></div>

<div class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:10.0pt;font-family:"Courier New""><span> </span>  <script
type="text/javascript"><br>
      function initialize() {<br>
        var mapOptions = {<br>
          center: new google.maps.LatLng(-34.397, 150.644),/*
I want to plug in values here*/<br>
          zoom: 8,<br>
          mapTypeId: google.maps.MapTypeId.ROADMAP<br>
        };<br>
        var map = new google.maps.Map(document.getElementById("map_canvas"),<br>
            mapOptions);<br>
      }<br>
    </script></span></div>

</div></div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div>