Brilliant. That works. The problem was that I was using the -sql switch to
query from postgis directly into KML. Apparently that does not work at lest
with my query string. Dumping with psql2shape and then ogr2ogr to convert
to KML did the trick. Thanks.

Now to figure out how to switch the drawing order...

THK


On Wed, Oct 30, 2013 at 12:54 AM, Jukka Rahkonen
<[email protected]>wrote:

> Tim Keitt <tkeitt <at> utexas.edu> writes:
>
> >
> >
> > OK. Now I have my PEN styles loaded in the table. The KML driver is still
> writing only red. Anyone how to get KML to use the OGR_STYLE column?
>
> Have another try. I digitized some lines and set OGR_STYLE to something
> like
> PEN(c:#0000FF,w:8px). Saved into shapefile and checked with ogrinfo
> ogrinfo kml.shp kml
>
> OGRFeature(kml):2
>   OGR_STYLE (String) = PEN(c:#0000FF,w:8px)
>   Style = PEN(c:#0000FF,w:8px)
>
> OGR_STYLE attribute has been converted into feature style. Data are OK to
> play with.
>
> Then convert into kml with both "KML" and "LIBKML" drivers and check with
> ogrinfo
>
> KML driver
> ==========
> OGR_STYLE (String) = PEN(c:#0000FF,w:8px)
> Style = PEN(c:#0000FFFF,w:8.000000px)
>
> LIBKML driver
> =============
>  OGR_STYLE (String) = PEN(c:#0000FF,w:8px)
>  Style = PEN(c:#0000FFFF,w:2.822228px)
>
> Conclusion: Both drivers take the pen color. LIBKML is changing the line
> width for some reason at least in this test. My features were reprojected
> from EPSG:3067 into EPSG:4326 in my little test but I did not make further
> tests to see if this is the reason. Anyway, I can change colors with GDAL
> 1.10 so I believe you will do the same soon.
>
> I checked also with GE and colours do show.
>
> -Jukka-
>
>
> _______________________________________________
> gdal-dev mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
http://www.keittlab.org/
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to