[Gdal-dev] KML with descriptions from Postgis Views via ogr2ogr
g.moes at web.de
Mon Feb 2 04:21:52 EST 2009
Thanks for your quick reply,
I'll have a look at the KML-page, maybe I'll find out what is wrong with my
I know that postgis offers the new function asKML(), but I still work with
postgresql 8.2 and the older version of postgis where this function isn't
yet available. It looks, as it should be worth to upgrade to the latest
Nevertheless I would be interested in an php-way to use ogr2ogr.
Andreas Neumann wrote:
> Hi Georges,
> I usually generate my KML files with a scripting language like PHP or
> Perl. It gives you more fine-grained control over the structure and
> content of the KML as opposed to "automatic" conversions like ogr2ogr or
> It might be useful to post your KML somewhere if you want to have
> The KML tutorials at Google might be useful to get more insight on what
> might be wrong with your KML:
> also contains a KML reference.
> If you want I can send you PHP examples how I generate polygons to KML
> from Postgis. It is actually quite simple, since Postgis already offers
> the AsKML() command for converting the geometry.
>> I'm really impressed by the command-line functionality of ogr2ogr, since
>> found until now no suitable gui to use it under Windows.
>> Actually I try to create KML-files from Postgressql/Postgis-data with
>> ogr2ogr, which works fine. I encountered only two problems, that I
>> solve until now. Maybe there is someone that can help me.
>> My command looks like this:
>> ogr2ogr -f KML c:/parzellen.kml PG:"host=localhost port=5432 dbname=test
>> user=postgres password=XXXX" -sql "select ka_nr, ka_sect as Sektion,
>> as Flur, ka_akte as Kaufakte, kart_dat as Kartierdatum, kart_pers as
>> Kartierer, pacht as PÃ¤chter, transform(the_geom,4326) from
>> -dsco NameField=kadaster_nr -dsco
>> My main problem is, that the kml-file is created, but doesn't display at
>> right place in Google Earth. When opening the file in GE first GE zooms
>> close to the place, where the polygons should be. When I click in GE on
>> imported layer, all the polygons are there, but they are displayed as
>> marker??? When I click them, I get a balloon, with only a part of the
>> informations I wanted to be displayed. The main problem is, that the
>> balloons sit 'lost in space', meens outside the earth somewhere in space
>> When i hover the balloons with the mouse, the displayed lat and lon, and
>> hight values are OK.
>> I've tried to indicate the source and the target projection with -s_srs
>> "EPSG:2169" or -t_srs "EPSG:4326", but without other results.
>> The underlying table works fine, so maybe there is a problem with using
>> views in ogr2ogr???
>> The other problem is, that the kml-file only contains the NameField and
>> 3 first DescriptionFields (Sektion,Flur,Kaufakte), the rest is ignored.
>> there any restrictions I've ignored?
>> Maybe there is someone, who could give me an a tip or an answer to my
>> View this message in context:
>> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
> Andreas Neumann
> Böschacherstrasse 6, CH-8624 Grüt/Gossau, Switzerland
> Email: a.neumann at carto.net, Web:
> * http://www.carto.net/ (Carto and SVG resources)
> * http://www.carto.net/neumann/ (personal page)
> * http://www.svgopen.org/ (SVG Open Conference)
> * http://www.geofoto.ch/ (Georeferenced Photos of Switzerland)
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
View this message in context: http://n2.nabble.com/KML-with-descriptions-from-Postgis-Views-via-ogr2ogr-tp2255911p2257086.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
More information about the gdal-dev