[mapserver-users] STYLEITEM AUTO and LABEL ENCODING can't exist simultaneously??
TENGDA
txstudio at yeah.net
Sun Oct 12 23:21:23 PDT 2014
Hi All,
Is there any method that I can both set 'STYLEITEM AUTO', and also set ENCODING GB18030? NOTE: my mapserv is V5.2.1.
[PROBLEM]:
I am now using mapinfo tab files as my map data.
Labels in the mapinfo files are in Chinese. In order to support styles within mapinfo, I use 'STYLEITEM AUTO'.
Then style are displayed well, however, Chinese characters are not displayed properly.
[PROBLEM DESCRIPTION]:
Mapserver version: 5.2.1.
MapServer version 5.2.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF
OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICO
NV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUP
PORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS INPUT=OGR
INPUT=GDAL INPUT=SHAPEFILE
ogrinfo of tab file:
OGRFeature(2000_BJ10):4
blank (String) =
Style = LABEL(t:"育",a:0.000000,s:1.380000g,c:#000000,p:1,f:"")
POINT (1017054046.578231 612967797.60216415)
[CONFUSING]:
When I use STYLEITEM AUTO, I can't set 'ENCODING GB18030' for LABEL.
If not using STYLEITEM AUTO, I can't set LABELITEM, because the chinese character is within Style=LABEL(t:"Chinese character"....).
Method I also tried includes:
Change mapfile encoding from ANSI to UTF-8
Change MIF/MID encoding from ANSI to UTF-8, or even to BIG5.
So, is there any method that I can both set 'STYLEITEM AUTO', and also set ENCODING GB18030? NOTE: my mapserv is V5.2.1.
[MORE INFORMATION]:
I also have another mapinfo tab file, whose data is like this:
ENAME2000: String (50.0)
OGRFeature(省界):1
NAME (String) = 北京市
AREA (Real) = 1.733
PERIMETER (Real) = 8.498
省界_ (Real) = 9
省界_ID (Real) = 11
CODE2000 (Real) = 110000
ENAME2000 (String) = Beijing Municipality
Style = BRUSH(fc:#f0f0f0,bc:#ffffff,id:"mapinfo-brush-2.ogr-brush-0");PEN(w:1p
x,c:#d0d0d0,id:"mapinfo-pen-2.ogr-pen-0")
In this situation, I can use one layer with 'STYLEITEM AUTO' to display styles, and another layer with 'LABELITEM NAME' and LABEL ... END to display Labels, without any problem. Mapfile is as follow:
LAYER
##DATASOURCETYPE 0
NAME "test"
TYPE polygon
STATUS DEFAULT
OPACITY 100
SIZEUNITS pixels
DATA "省界"
CONNECTION "C:\ms4w\Apache\htdocs\mapinfo\省界.TAB"
CONNECTIONTYPE ogr
STYLEITEM "AUTO"
PROJECTION
AUTO
END
CLASS
NAME "Untitled class"
END
END
LAYER
##DATASOURCETYPE 0
NAME "省界"
TYPE annotation
STATUS DEFAULT
OPACITY 100
SIZEUNITS pixels
DATA "省界"
CONNECTION "C:\ms4w\Apache\htdocs\mapinfo\省界.TAB"
CONNECTIONTYPE ogr
PROJECTION
AUTO
END
LABELITEM "NAME"
CLASS
NAME "Untitled class"
LABEL
ANGLE auto
FONT "HEITI"
ENCODING "GB18030"
TYPE truetype
PRIORITY 1
SIZE 10
MAXSIZE 256
MINSIZE 4
COLOR 255 0 0
OUTLINECOLOR 0 255 255
BACKGROUNDSHADOWSIZE 1 1
POSITION cc
ANTIALIAS FALSE
FORCE FALSE
PARTIALS FALSE
END
END
END
As you can see the difference between the two kinds of tab file,
one set chinese character in to LABEL(t:'') field, in which I not know how to both set STYLEITEM AUTO and set ENCODING to LABEL.
the other set Chinese character to the NAME field, in which I can set one layer with STYLEITEM AUTO, and another layer with LABELITEM.
Can anyone solve the problem I described in this post?
Waiting for your reply. Thanks very much.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20141013/78b9123b/attachment.htm>
More information about the MapServer-users
mailing list