<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Nicolas, this is perfect - exactly what I needed, and now I understand the issue.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>Many thanks!<br></span></div><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <br> </font> </div> <br>
Hi,<br><br>You have to transform your data from their native SRID to 4326 (or<br>other Lat/Lon CRS).<br><br>Looks like testdb.places does not store data in lat/lon but in a<br>projected coordinate system.<br><br>Try: select ST_X(st_transform(geo_location,<br>4326)),ST_Y(st_transform(geo_location, 4326)) from testdb.places<br><br>NIcolas<br><br>On 10 October 2012 13:36, Michal Zimmermann <<a ymailto="mailto:zimmicz@gmail.com" href="mailto:zimmicz@gmail.com">zimmicz@gmail.com</a>> wrote:<br>> How about ST_AsText(geometry)?<br>><br>> Dne 10.10.2012 13:27 "Marky Mark" <<a ymailto="mailto:markymark9705@yahoo.com" href="mailto:markymark9705@yahoo.com">markymark9705@yahoo.com</a>> napsal(a):<br>>><br>>> Hi,<br>>><br>>> This is the definition of a newbie question but how do I take a<br>>> PostGIS-generated geometry value such as<br>>> "0101000020346C0000F5A4B17560061841A3D4467F89992841" and convert it to
 a<br>>> latitide and longitude to plug into a Google Map (as below)? I've tried<br>>> using the following code in Postgres to extract lat & long:<br>>><br>>> select ST_X(geo_location),ST_Y(geo_location) from testdb.places<br>>><br>>> SELECT ST_X(geo_location::geometry), ST_Y(geo_location::geometry) FROM<br>>> testdb.places;<br>>><br>>> And these both produce values 393624.114935472,806084.74858727 for the<br>>> above geometry value (I'd expect something like 57.1500,-2.1000)<br>>><br>>> What incredibly stupid thing am I not grasping here?<br>>><br>>> Many thanks, Marko<br>>><br>>>    <script type="text/javascript"><br>>>       function initialize() {<br>>>         var mapOptions = {<br>>>           center: new google.maps.LatLng(-34.397, 150.644),/* I want
 to<br>>> plug in values here*/<br>>>           zoom: 8,<br>>>           mapTypeId: google.maps.MapTypeId.ROADMAP<br>>>         };<br>>>         var map = new<br>>> google.maps.Map(document.getElementById("map_canvas"),<br>>>             mapOptions);<br>>>       }<br>>>     </script><br>>><br>>> _______________________________________________<br>>> postgis-users mailing list<br>>> <a ymailto="mailto:postgis-users@postgis.refractions.net" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>>> http://postgis.refractions.net/mailman/listinfo/postgis-users<br>>><br>><br>> _______________________________________________<br>> postgis-users mailing list<br>> <a
 ymailto="mailto:postgis-users@postgis.refractions.net" 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><br><br> </div> </div>  </div></body></html>