[postgis-users] Plotting PostGIS/Postgress points on a Google Map

Michal Zimmermann zimmicz at gmail.com
Wed Oct 10 04:36:41 PDT 2012


How about ST_AsText(geometry)?
Dne 10.10.2012 13:27 "Marky Mark" <markymark9705 at yahoo.com> napsal(a):

> Hi,
>
> 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:
>
> select ST_X(geo_location),ST_Y(geo_location) from testdb.places
>
> SELECT ST_X(geo_location::geometry), ST_Y(geo_location::geometry) FROM
> testdb.places;
>
> And these both produce values 393624.114935472,806084.74858727 for the
> above geometry value (I'd expect something like 57.1500,-2.1000)
>
> What incredibly stupid thing am I not grasping here?
>
> Many thanks, Marko
>
>    <script type="text/javascript">
>       function initialize() {
>         var mapOptions = {
>           center: new google.maps.LatLng(-34.397, 150.644),/* I want to
> plug in values here*/
>           zoom: 8,
>           mapTypeId: google.maps.MapTypeId.ROADMAP
>         };
>         var map = new
> google.maps.Map(document.getElementById("map_canvas"),
>             mapOptions);
>       }
>     </script>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20121010/d46ccbe4/attachment.html>


More information about the postgis-users mailing list