[gdal-dev] Does "OGR_STYLE from rivers" mean it will read rivers.ofs ?

積丹尼 Dan Jacobson jidanni at jidanni.org
Sat Jul 2 08:34:27 PDT 2016


I failed miserably at adding ANY style to a shapefile.

$ ogrinfo -al -q zk2.shp|colrm 66
Layer name: zk2
Metadata:
  DBF_DATE_LAST_UPDATE=2016-07-02
OGRFeature(zk2):0
  Name (String) = zaokeng main road 中45市道
  descriptio (String) = (null)
  timestamp (Date) = (null)
  begin (Date) = (null)
  end (Date) = (null)
  altitudeMo (String) = (null)
  tessellate (Integer) = 1
  extrude (Integer) = 0
  visibility (Integer) = -1
  drawOrder (Integer) = (null)
  icon (String) = (null)
  LINESTRING Z (120.86817 24.17922 0,120.86816 24.17922 0,120.868

$ cat zk2.ofs
OFS-Version: 1.0
StyleField: "style"

DefaultStyle: PEN(C:#000000FF)
road:      PEN(c:#FF0000,w:5px)
lake:      BRUSH(fc:#0000FF);PEN(c:#000000)
campsite:  SYMBOL(c:#00FF00,id:"points.sym-45,ogr-sym-7")
label:     LABEL(f:"Times New Roman",s:12pt,t:{text_string})

$ ogr2ogr -lco ENCODING=UTF-8 -f "ESRI Shapefile" -sql "select *, OGR_STYLE from zk2" x.shp zk2.shp
$ ogrinfo -al -q x.shp|colrm 66
Layer name: x
Metadata:
  DBF_DATE_LAST_UPDATE=2016-07-02
OGRFeature(x):0
  Name (String) = zaokeng main road 中45市道
  descriptio (String) = (null)
  timestamp (Date) = (null)
  begin (Date) = (null)
  end (Date) = (null)
  altitudeMo (String) = (null)
  tessellate (Integer) = 1
  extrude (Integer) = 0
  visibility (Integer) = -1
  drawOrder (Integer) = (null)
  icon (String) = (null)
  OGR_STYLE (String) = (null)
  Style =
  LINESTRING Z (120.86817 24.17922 0,120.86816 24.17922 0,120.868

Not even the DefaultStyle. Total failure.


More information about the gdal-dev mailing list