[mapserver-users] line layer label angle changes (SOLVED!)

gisweb at lmi.net gisweb at lmi.net
Tue Sep 24 17:57:18 EDT 2002


List,

As a courtesy to others with similar problems, here's a problem summary and 
solution.  (Thanks to Steve Woodbridge for the ongoing support!)

Problem summary:
     System: FreeBSD
     Access: No root access, but local builds okay
     Mapserver version: 3.6.1
     Goal:  Build mapserver with true type support.
     Issue:  Machine has an existing version of Freetype 2.x at the system 
level. The ./configure routine recognizes the Freetype 2.x rather than the 
(required) Freetype 1.x even when statically pointed to the Freetype 1.x 
libraries.

Problem solution:
     All of the following steps were required to successfully build mapserver 
in the above environment...
     1) Compile GD 1.8.4 and Freetype 1.3.1 to local directories.

     2) In the .login, add:
     # Added for mapserver purposes:
     setenv LD_LIBRARY_PATH /path/to/libttf.so.4.0
     # End of mapserver additions.

     3) Configure mapserver with the following parameters (plus any others you 
want):
     ./configure --prefix=/path/to/libraries 
                 --with-gd=static,/path/to/libraries 
                 --with-freetype=/path/to/freetype 
                 --enable-force-freetype1 
                 --enable-runpath 
                 --with-proj 
                 --with-tiff

     4) Edit the resulting mapserver Makefile as follows:

     # These originally pointed to root-only system directories.
     # Change them to your local installation directories.
     LIB_INSTALL=/usr/home/gisweb/local/lib/
     HEADER_INSTALL=/usr/home/gisweb/local/include/mapserver-3.5/

     # Proj.4 distribution (cartographic projection routines).
     #PROJ_INC  <-- originally blank.  Needed the reference as shown on line 
below.
     PROJ_INC=-I/usr/local/include 
     PROJ_LIB= -lproj
     PROJ=     -DUSE_PROJ -DUSE_PROJ_API_H

     # GD distribution (graphics library GIF and/or PNG support). (REQUIRED)
     #
     GDFONT_OBJ=gd-1.2/gdfontt.o gd-1.2/gdfonts.o gd-1.2/gdfontmb.o gd-
1.2/gdfontl.o gd-1.2/gdfontg.o
     GD_INC=  -I/usr/home/gisweb/local/lib
     #GD_LIB=   -ljpeg -lfreetype -lpng -lz  <-- originally refers to -
lfreetype.
     GD_LIB= -lm -lgd -lpng -lz -ljpeg -lttf 
     GD=       -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_TTF
     GD_STATIC = /usr/home/gisweb/local/lib/libgd.a

     # TIFF distribution (raster support for TIFF and GEOTIFF imagery). 
(RECOMMENDED)
     TIFF_INC= 
     #TIFF_LIB= -ltiff -ljpeg -lpng -lz -lfreetype  <-- originally has -
lfreetype
     TIFF_LIB= -ltiff -ljpeg -lpng -lz -lttf
     TIFF=     -DUSE_TIFF

     5) From the mapserver-3.6.1 directory containing the modified Makefile, 
type:
     make install
     make

     6) Typing "./mapserv -v" should return the following (Note "SUPPORTS=TTF"):
     MapServer version 3.6.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ 
SUPPORTS=TTF SUPPORTS=WMS_SERVER INPUT=TIFF INPUT=EPPL7 INPUT=JPEG 
INPUT=SHAPEFILE

     These steps eliminated the problem of the incorrect True Type angles when 
using the ANGLE AUTO parameter in a LABEL object.

     Hope this helps others with similar problems.

     Thanks again to all who offered support.

- Jonathan W. Lowe


Quoting gisweb at lmi.net:

> Combating the same problem with incorrect label angles (on FreeBSD), I also
> recompiled gd with references to freetype-1.3.1, but the mapserver configure
> couldn't find it.  The compile and make still ran, but the resulting mapserv
> program doesn't recognize truetype parameters.  Suggestions?
> 
> Here's the configure command and resulting output:
> 
> ./configure --prefix=/usr/home/gisweb/local --with-gd=/usr/home/gisweb/local
> --w
> ith-freetype=/usr/home/gisweb/local/include/freetype --enable-force-freetype1
> --
> enable-runpath --with-proj --with-tiff
> 
> loading cache ./config.cache
> checking for gcc... (cached) gcc
> checking whether the C compiler (gcc  ) works... yes
> checking whether the C compiler (gcc  ) is a cross-compiler... no
> checking whether we are using GNU C... (cached) yes
> checking whether gcc accepts -g... (cached) yes
> checking for c++... (cached) c++
> checking whether the C++ compiler (c++  ) works... yes
> checking whether the C++ compiler (c++  ) is a cross-compiler... no
> checking whether we are using GNU C++... (cached) yes
> checking whether c++ accepts -g... (cached) yes
> checking for ranlib... (cached) ranlib
> checking for flex... (cached) flex
> checking for yywrap in -lfl... (cached) yes
> checking for bison... (cached) bison -y
> checking if compiler supports -R... (cached) no
> checking if compiler supports -Wl,-rpath,... (cached) no
> checking if compiler supports -Wl,-R... (cached) yes
> checking for exp in -lm... (cached) yes
> checking how to run the C preprocessor... (cached) gcc -E
> checking for ANSI C header files... (cached) yes
> checking for strcasecmp... (cached) yes
> checking for strncasecmp... (cached) yes
> checking for strdup... (cached) yes
> checking whether we should include JPEG support...
> checking for jpeg_read_header in -ljpeg... yes
>         using libjpeg from system libs.
> checking which version of GD to use...
>         using libgd from -L/usr/home/gisweb/local/lib -lgd
> checking where FreeType is installed...
> checking for TT_Init_FreeType in -lttf... no
> checking for FT_Init_FreeType in -lfreetype... yes
>         using libfreetype -lfreetype from system libs.
> checking where Zlib is installed...
> checking for zlibVersion in -lz... yes
>         using libz from system libs.
> checking where PNG is installed...
> checking for png_init_io in -lpng... yes
>         using libpng from system libs.
> checking for gdImageGif in -lc... no
> checking for gdImagePng in -lc... yes
> checking for gdImageJpeg in -lc... yes
> checking for gdImageWBMP in -lc... yes
> checking for gdImageStringFT in -lc... no
> checking for gdImageStringTTF in -lc... no
> checking for gdImageString16 in -lc... yes
> checking for gdImageGifPtr in -lc... no
>         using GD ( -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP) from
> /usr/home/gisw
> eb/local.
> checking whether we should include PDF support...
> checking for PDF_setlinewidth in -lpdf... yes
> checking for PDF_setrgbcolor in -lpdf... yes
> checking for PDF_moveto in -lpdf... yes
> checking for PDF_curveto in -lpdf... yes
> checking for PDF_show_xy in -lpdf... (cached) yes
>         using libpdf from system libs.
> checking whether we should include TIFF support...
> checking for TIFFOpen in -ltiff... yes
>         using libtiff from system libs.
> checking whether we should include EPPL7 support...
>         including EPPL7 support.
> checking whether we should include PROJ.4 support...
> checking for pj_init in -lproj... yes
> checking for pj_transform in -lproj... yes
> checking for pj_latlong_from_proj in -lproj... yes
>         using PROJ.4 from system libs.
> checking whether we should include thread safe support...
>         thread safe support disabled.
> checking whether we should include ESRI SDE support...
>         ESRI SDE support not requested.
> checking whether we should compile in MPATROL support...
>         MPATROL support not requested.
> checking whether we should include OGR support...
>         OGR support not requested.
> checking if GDAL support requested... no
> checking if PostGIS support requested... no
> checking if OracleSpatial support requested... no
> checking whether we should include WMS support...
>         OGC WMS compatibility enabled (-DUSE_WMS).
> checking whether we should include WMS Client Connections support...
> Compiling with -DIGNORE_MISSING_DATA.
> checking whether we should enable debug features...
> checking for PHP/MapScript module options...
>         PHP/MapScript module not configured.
> updating cache ./config.cache
> creating ./config.status
> creating Makefile
> 
> Thank you,
> Jonathan W. Lowe
> 
> Quoting Sandor Csaba <c.sandor at emla.hu>:
> 
> > Thanks, it solved the problem. Although I had troubles compiling freetype1
> 
> > on Solaris (had to use --disable-nls --enable-static whatever these mean) 
> > and also naturally (not for me until today) I had to recompile gd too.
> > 
> > Csaba
> > 
> > At 07:48 20/09/2002 -0400, you wrote:
> > >This is a freetype 2 issue, just get libttf-1.3.1 and you problems
> > >should go away.
> > >
> > >-Steve W.
> > >  http://iMapTools.com
> > >
> > >On 20 Sep 2002 at 11:45, Sandor Csaba wrote:
> > >
> > > > Hi All,
> > > >
> > > > I want to label streets with their names. It works fine on my windows
> > > > box (downloaded binaries: ms36gif_gdal_pg_wms.zip). On a Solaris box
> > > > (the real Internet server, mapserv 3.6.1 CGI, Freetype2, PNG support)
> > > > the labels are randomly rotated around the same label point.
> > > >
> > > > Anybody had similar problems? Can this be a Freetype1 vs. 2 issue?
> > > >
> > > > I use the following label definition in the mapfile
> > > >
> > > > LABEL
> > > >  COLOR 0 0 0
> > > >  TYPE TRUETYPE
> > > >  FONT arial
> > > >  SIZE 10
> > > >  ANTIALIAS true
> > > >  POSITION AUTO
> > > >  PARTIALS TRUE
> > > >  MINFEATURESIZE 1
> > > >  FORCE FALSE
> > > >  BUFFER 3
> > > >  ANGLE AUTO
> > > > END
> > > >
> > > > Thanks,
> > > > Csaba
> > > >
> > > > -
> > > > {Kornyezeti Management es Jog Egyesulet
> > > > {Environmental Management and Law Association
> > > > {www.emla.hu
> > > > {1076 Budapest
> > > > {Garay u. 29-31
> > > > {Hungary
> > > > {Tel/fax: 36-1-3228462, 36-1-3529925
> > > > {Mobil: 06-20-949-1447
> > > >
> > > >
> > > >
> > 
> > 
> > -
> > {Kornyezeti Management es Jog Egyesulet
> > {Environmental Management and Law Association
> > {www.emla.hu
> > {1076 Budapest
> > {Garay u. 29-31
> > {Hungary
> > {Tel/fax: 36-1-3228462, 36-1-3529925
> > {Mobil: 06-20-949-1447
> > 
> > 
> > 
> > 
> 
> 
> 
> 





More information about the mapserver-users mailing list