Ticket #3618 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

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

ogrlibkmllayer_styleUrl.patch Download (0.8 KB) - added by msmitherdc 3 years ago.
patch to add styleUrl field export
ogrlibkmlfield_styleUrl.patch Download (1.6 KB) - added by msmitherdc 3 years ago.
patch to add styleUrl field export

Change History

Changed 3 years ago by msmitherdc

patch to add styleUrl field export

Changed 3 years ago by msmitherdc

patch to add styleUrl field export

Changed 3 years ago by msmitherdc

Patch attached

Changed 3 years ago by warmerdam

  • owner changed from warmerdam to winkey

Changed 3 years ago by winkey

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

Changed 3 years ago by msmitherdc

  • status changed from new to closed
  • resolution set to fixed

Works perfectly. Never mind then. Ticket closed.

Note: See TracTickets for help on using tickets.