[FWTools] convert postgis data to kml

Stefan Keller sfkeller at gmail.com
Wed Apr 2 19:22:30 EDT 2008


You can either use pgsql2shp from directory pgsql/bin, and then use OGR
(from GDAL/OGR/FWTools) to convert to KML
or you try it in one step like this using FWTools:
% ogr2ogr -f "KML" neighborhoods.kml PG:"host=myhost user=myloginname
dbname=mydbname password=mypassword" -sql "select gid, name, the_geom from
neighborhoods"
See
http://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet
-- Stefan

2008/4/2, Shad Keene <shadkeene at hotmail.com>:
>
> Hi,
> 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.
> 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,
> Shad
>
> *
> *
>
> ------------------------------
> More immediate than e-mail? Get instant access with Windows Live
> Messenger.<http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_instantaccess_042008>
>
> _______________________________________________
> FWTools mailing list
> FWTools at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/fwtools
> http://fwtools.maptools.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20080403/cae5cd73/attachment.html


More information about the FWTools mailing list