4

Using ogr2ogr I want to export tables from a PostGIS database as KML-files. I have succesfully used an "OGR_STYLE"-column/attribute on my line features to define line width and color, see: http://www.gdal.org/ogr_feature_style.html

An example of a line styling could be: PEN(c:#b3ff00,w:2.5px) - when using ogr2ogr this styling is applied to the output KML feature when displayed in Google Earth.

However, when I try to use this kind of styling for my point features (e.g. SYMBOL(c:#00FF00,id:"points.sym-45,ogr-sym-7") ), the default marker and color is displayed when opening the KML-file in Google Earth.

Is there any way to get this custom styling to work when exporting point features to KML?

1 Answer 1

0

Example with "shaded_dot" KML style

set icon="http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png"
set rgba150="#00FF00"

SYMBOL(c:%rgba150%,id:"%icon%")

or

   SYMBOL(c:#00FF00,id:"http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png")

So, resulted style definition in KML file will be:

  <Placemark id="points_test.4">
    <Style>
      <IconStyle>
        <color>ff00ffff</color>
        <Icon>
          <href>http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png</href>
        </Icon>
      </IconStyle>
    </Style>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.