<div>You can either use pgsql2shp from directory pgsql/bin, and then use OGR (from GDAL/OGR/FWTools) to convert to KML<br>or you try it in one step like this using FWTools:<br>% ogr2ogr -f "KML" neighborhoods.kml PG:"host=myhost user=myloginname dbname=mydbname password=mypassword" -sql "select gid, name, the_geom from neighborhoods"<br>
See <a href="http://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet">http://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet</a></div>
<div>-- Stefan<br> </div>
<div><span class="gmail_quote">2008/4/2, Shad Keene <<a href="mailto:shadkeene@hotmail.com">shadkeene@hotmail.com</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi,<br>My goal is to display various shapes(polygons, points, linestring) on google maps by using data entered into a postgis database. I was looking for a way to do this that used the spatial structure already provided in postgis(already designating if shape is a linestring or polygon, etc) instead of parsing out the coordinates and then re-entering spatial structure in google maps. I saw that google maps api is now compatible with kml data formats. And then I read that FWTools can convert postgis data to kml format. <br>
I've done some reading in the forums about the actual process of converting postgis data to kml via FWTools, but didn't see anything that would help me. I'm new to kml but am familiar with postgis and perl language. Is there a tutorial for the process of converting postgis data to kml? Where can I get started? Thanks for any help,<br>
Shad<br><br>
<div><font style="COLOR: rgb(0,0,255)" size="1"><span style="FONT-STYLE: italic; FONT-FAMILY: Lucida Handwriting,Cursive"></span></font><em><font face="Lucida Handwriting" color="#0000ff" size="1"><br></font></em></div><br>
<hr>
More immediate than e-mail? <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_instantaccess_042008" target="_blank">Get instant access with Windows Live Messenger.</a></div>
<br>_______________________________________________<br>FWTools mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:FWTools@lists.maptools.org">FWTools@lists.maptools.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.maptools.org/mailman/listinfo/fwtools" target="_blank">http://lists.maptools.org/mailman/listinfo/fwtools</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://fwtools.maptools.org/" target="_blank">http://fwtools.maptools.org/</a><br><br></blockquote></div><br>