[Gdal-dev] ogr2ogr Style usage

Frank Warmerdam warmerdam at pobox.com
Sun Jan 18 00:43:00 EST 2004


Vojtech Honzik wrote:

> I have probably really simple question - there is parameter -select in ogr
> utility program ogr2ogr. I guess how to set this parameter to extract some
> of the style information to dbf column in shapefile.
> Let say I have this fragment dumped using ogrinfo:
> ----
> OGRFeature(elements):117
>   Type (Integer) = 17
>   Level (Integer) = 31
>   GraphicGroup (Integer) = 0
>   ColorIndex (Integer) = 1
>   Weight (Integer) = 0
>   Style (Integer) = 0
>   EntityNum (Integer) = (null)
>   MSLink (Integer) = (null)
>   Text (String) = Presslova
>   Style = LABEL(t:"Presslova",c:#0000ff,s:12g,a:344)
>   POINT (-774288.023 -1126770.841)
> ---
> 
> and need to extract some variables from Style
> 
> ogr2ogr -skipfailures -f "ESRI Shapefile" -select Type,Level,Style -dsco
> SEED=seed2 d.dgn -nln ulice_pop ulice_pop ulice_pop.dgn
> 
> I think there has to be some special call to specify an LABEL item to
> translate.

Vojtech,

I am afraid the "style" value isn't stored as a normal value, and so it
cannot be included in the "-select" list.  However, it would normally
be copied to the destination dataset if the destination driver supports
writing styles.  Unfortunately ... to the best of my knowledge ... no
OGR driver supports writing styles.

Aha Daniel ... I told you it would turn out to be bad that the styles
aren't regular attributes!

You could hack ogr2ogr to places the styles into a regular attribute in
output datasets but it would require some code changes.  I should make
that change to the master somehow ... perhaps as a special option in
-select as you suggest.  However, I won't be doing that tonight.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list