[Gdal-dev] MapInfo Text Features in OGR
Frank Warmerdam
warmerdam at pobox.com
Mon Oct 31 15:52:00 EST 2005
On 10/31/05, Bob Cave <rlcave3rd at yahoo.com> wrote:
> Hello,
>
> I am writing a program to load and display vector
> files using OGR. For my initial testing, I am using
> MapInfo TAB files as input. TAB files can include a
> text feature element. How are those represented in
> OGR? I've noticed that the OGRFeature object
> associated with the text feature contains a point
> geometry, which makes sense as the location, but where
> is the text and other descriptive information (font,
> alignment, etc.)? The style string pointer is null.
Bob,
I believe that the text features and related rendering
information (font, color, etc) are returned as the
"style string" for the feature.
I don't seem to have a text file handy, but if I run
ogrinfo on a mapinfo file with point symbols I see:
OGRFeature(SampleSpeedHeading):1
lon (Real) = -80.7188
lat (Real) = 23.3125
knots (Real) = 0.152118
Heading (String) = 122
ID (Integer) = 1
Style = SYMBOL(a:0,c:#ff00ff,s:6pt,id:"mapinfo-sym-34.ogr-sym-4")
POINT (-80.718800000000002 23.3125)
The "Style" line is a special sort of attribute fetched with the
OGRFeature::GetStyleString() method:
http://www.gdal.org/ogr/classOGRFeature.html#e6ad46c5574cdc328ad029958dc976a5
The style strings should conform to the OGR Feature Style Specification.
Read over the section on the LABEL tool in the most detail.
http://www.gdal.org/ogr/ogr_feature_style.html
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