Opened 13 years ago
Closed 13 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)
Change History (6)
by , 13 years ago
Attachment: | ogrlibkmllayer_styleUrl.patch added |
---|
by , 13 years ago
Attachment: | ogrlibkmlfield_styleUrl.patch added |
---|
patch to add styleUrl field export
comment:2 by , 13 years ago
Owner: | changed from | to
---|
comment:3 by , 13 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 , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Works perfectly. Never mind then. Ticket closed.
patch to add styleUrl field export