Opened 14 years ago

Closed 14 years ago

#3618 closed enhancement (fixed)

add StyleUrl as field output option to libkml driver

Reported by: msmitherdc Owned by: winkey
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: trivial Keywords: libkml
Cc:

Description

The StyleUrl value is not available when exporting kml to other formats and it is a useful attribute to export.

Attachments (2)

ogrlibkmllayer_styleUrl.patch (810 bytes ) - added by msmitherdc 14 years ago.
patch to add styleUrl field export
ogrlibkmlfield_styleUrl.patch (1.6 KB ) - added by msmitherdc 14 years ago.
patch to add styleUrl field export

Download all attachments as: .zip

Change History (6)

by msmitherdc, 14 years ago

patch to add styleUrl field export

by msmitherdc, 14 years ago

patch to add styleUrl field export

comment:1 by msmitherdc, 14 years ago

Patch attached

comment:2 by warmerdam, 14 years ago

Owner: changed from warmerdam to winkey

comment:3 by winkey, 14 years ago

msmitherdc

styleUrl shows up as featurestyle as per the ogr feature style spec.

I did not add this because OGR already has a way of dealing with feature style in formats that do not support it.

the folowing is from http://www.gdal.org/ogr/ogr_feature_style.html

2.9 Using OGR SQL to transfer the style between the data sources

We can use the OGR_STYLE special field to extract the feature level style, and ogr2ogr can be used to transfer the style string between the data sources according to the following example:

ogr2ogr -f "ESRI Shapefile" -sql "select *, OGR_STYLE from rivers" rivers.shp rivers.tab

Without specifying the length of the style field the output driver may truncate the length to a default value. Therefore it may be necessary to specify the target length manually, like:

ogr2ogr -f "ESRI Shapefile" -sql "select *, CAST(OGR_STYLE AS character(255)) from rivers" rivers.shp rivers.tab

OGR is aware of using the OGR_STYLE field if exists and OGRFeature::GetStyleString will return the value of this field if no style string have been specified programmatically.

Brian

comment:4 by msmitherdc, 14 years ago

Resolution: fixed
Status: newclosed

Works perfectly. Never mind then. Ticket closed.

Note: See TracTickets for help on using tickets.