Discussion:
STYLEITEM AUTO and LABEL ENCODING can't exist simultaneously??
Rahkonen Jukka (Tike)
2014-10-13 06:54:58 UTC
Permalink
Hi,

It seems that you have done a good work by studying the situation yourself and it looks like combination “styleitem auto” and “encoding GB18030” does not work in your environment. However, it is unlikely that you will get any better answer that this one I am writing because you are using version 5.2.1 which was released 2008-12-08.  There can’t be many users worldwide who are using that old version, Chinase character set, and data from MapInfo TAB.

I suggest you to update to version 6.5-dev or at least 6.4.1 and repeat your test. If it still fails, prepare a test package with a small sample of MapInfo data and a minimal but complete mapfile so other users and developers can reproduce the issue.

-Jukka Rahkonen-


TENGDA wrote:

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.
Eva Jelínková
2014-10-22 08:57:18 UTC
Permalink
Hi,

I am using MapServer 6.4.1 and I also encountered the problem with encoding
while using STYLEITEM AUTO.

There is my mapfile and DGN file in an attachment. This mapfile works well,
because I defined LABEL there (I can! what an advantage compared to
Chinese...), but when I leave CLASS empty and set STYLEITEM AUTO, special
characters are not displaying. In this small case I can use LABEL encoding
and I can display data correctly, but if I have different DGN file with
many labels in it and in many styles, it is really unpleasant to style them
all just because of encoding...

I would really appreciate if there is possibility to define encoding in
STYLEITEM AUTO mode.

Thank you,
Eva Jelinkova

P.S.: EPSG:5514 is:
<5514> +proj=krovak +lat_0=49.5 +lon_0=24.83333333333333
+alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel
+pm=greenwich +units=m +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56
+no_defs <>
Post by Rahkonen Jukka (Tike)
Hi,
It seems that you have done a good work by studying the situation yourself
and it looks like combination “styleitem auto” and “encoding GB18030” does
not work in your environment. However, it is unlikely that you will get any
better answer that this one I am writing because you are using version
5.2.1 which was released 2008-12-08. There can’t be many users worldwide
who are using that old version, Chinase character set, and data from
MapInfo TAB.
I suggest you to update to version 6.5-dev or at least 6.4.1 and repeat
your test. If it still fails, prepare a test package with a small sample of
MapInfo data and a minimal but complete mapfile so other users and
developers can reproduce the issue.
-Jukka Rahkonen-
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.
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.
• 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
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)
• 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"....).
• 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.
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
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.
_______________________________________________
mapserver-users mailing list
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Loading...