[postgis-users] How to arrange the position of the_geom column?

Eli Juniati elly_tgd_05 at ymail.com
Thu Jul 16 01:23:09 PDT 2009


halo All..
i'm sorry with my english...

i'm new in postgis and gmaps
my
mini-project are: convert shp data into postgreSQL then display
(marking and make a pop_up)  the data on google maps as dynamicly.

i have been, convert data.shp into postgreSQL using shp2pgsql, type of data are point, line, and polygon.
then, i want to display this data on google maps, using php and the output file in XML, like on the article Using
PHP/MySQL with Google Maps written by Pamela Fox.

To
marker data on gmaps, the sintax need GLatLng, but the position
geometry (the_geom) in postgis not in Lat,Lng but in Lng,Lat..
if, the type data is a point, it doesn't matter. In my query i used:
$sql = "SELECT  id_bgnan, nm_gedung, (y(the_geom)), (x(the_geom)) FROM bangunan_geo where nm_gedung='$detail'";
to arrange the position geometry/coordinat(the_geom) into Lat, Lng.
then i parse the xml using:
echo '<plotting>';
    while ($row=pg_fetch_array($hasil))
    {
        echo '<plot ';
        echo 'id="' . parseToXML($row['0']) . '" ';
        echo 'nama="' . parseToXML($row['1']) . '" ';
        echo 'lat="' . parseToXML($row['2']) . '" ';
        echo
 'lng="' . parseToXML($row['3']) . '" ';
        echo '/>';
        
    }
    echo '</plotting>';

My question is, how if the type data not in point, but in polygon?
Regards

___Eli___


      Berselancar lebih cepat. Internet Explorer 8 yang dioptimalkan untuk Yahoo! otomatis membuka 2 halaman favorit Anda setiap kali Anda membuka browser. Dapatkan IE8 di sini! 
http://downloads.yahoo.com/id/internetexplorer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090716/0e38b205/attachment.html>


More information about the postgis-users mailing list