[Mapserver-users] mapserv cgi andraster layers again

Andrew selkiesdad at twcny.rr.com
Sat Apr 17 08:36:12 EDT 2004


I have checked everything, verified all the gdal libraries and operation 
of the binary utilities, and everything checks out. I see no obvious 
library conflicts. I have "fixed" all of my original problems except the 
display of tiff/geotiff layers.

I have installed the geotiff libraries (libgeotiff 1.1.4 to match my 
libtiff version) to be complete. I recompiled the mapserver 4.0.2 source 
with many variations on the makefile OGR/GDAL_INC and OGR/GDAL_LIB 
paths, and I tried modifying the libtiff/libgeotiff references in 
reasonable ways as well. I have observed that very subtle changes to the 
gdal lib options (include or omit the -lgdal switch) and/or the libtiff 
options  (-lgeotiff and related) can have no impact on the success of 
the compilation, but may or may not produce a mapserv cgi lacking wms 
capability, or png capability, etc. The evidence suggests that on my 
system the configure process may not be creating the appropriate 
Makefile for correctly linking gdal support. The manual tweaks I had to 
make for the 4.0.0 source and the influence of some of  the extra 
switches I added to the Makefile for 4.0.2 implies that although the 
dependencies may seem satisfied, some error in the file causes the 
actual invocation of the resulting binaries to fail without warning. I 
can work around this by using png and world files, but the extra work 
required to convert the available tiff files I need for my project into 
correctly georeferenced png files is discouraging. I hope someone can 
provide a clue as to what I can try next. Below is my current mapserver 
4.0.2 configure command and   Makefile.

$ ./configure --prefix=/usr/local/mapserve --with-freetype=/usr/local/mapserve --with-gd=/usr/local/mapserve --with-proj=/usr/local/mapserve --with-threads --with-gdal=/usr/local/mapserve/bin/gdal-config --with-ogr --with-php=/usr/local/php/phpsrc -with-wmsclient --with-wfs



# Run ./configure in the main MapServer directory to turn this Makefile.in
# into a proper Makefile

LIB_INSTALL=/usr/local/lib/
HEADER_INSTALL=/usr/local/include/mapserver-3.5/

#
# mpatrol runtime memory debugger
#
MPATROL=  	
MPATROL_INC=	
MPATROL_LIB=	

#
# If you want to ignore missing datafile errors uncomment the following
# line. This is especially useful with large tiled datasets that may not
# have complete data for each tile.
#
#IGNORE_MISSING_DATA=-DIGNORE_MISSING_DATA
IGNORE_MISSING_DATA = -DIGNORE_MISSING_DATA

#
# Apparently these aren't as commonplace as I'd hoped. Edit the
# following line to reflect the missing functions on your platform.
#
# STRINGS=-DNEED_STRCASECMP -DNEED_STRNCASECMP -DNEED_STRDUP
STRINGS= 

# Proj.4 distribution (cartographic projection routines). Not required for normal use. (EXPERIMENTAL)
PROJ_INC= -I/usr/local/mapserve/include
PROJ_LIB= -L/usr/local/mapserve/lib -lproj
PROJ=     -DUSE_PROJ -DUSE_PROJ_API_H

# GD distribution (graphics library GIF and/or PNG support). (REQUIRED)
#
#   - Versions 1.3 to 1.5 write non-LZW GIF (-DUSE_GD_1_3).
#   - Versions 1.6 and greater write PNG (-DUSE_GD_1_6). Add -lpng -lz to GD_LIB line.
#
#
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/local/mapserve/include
GD_LIB=  -L/usr/local/mapserve/lib -lgd -ljpeg -L/usr/local/mapserve/lib -lfreetype -lz -lpng -lz  
GD=       -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT
GD_STATIC = 

# PDFlib distribution (PDF library w/ PDF support). (EXPERIMENTAL)
#
#
#
PDF_INC=  
PDF_LIB=  
PDF=      

# TIFF distribution (raster support for TIFF and GEOTIFF imagery). (RECOMMENDED)
TIFF_INC= 
TIFF_LIB= -ltiff  -ljpeg -L/usr/local/mapserve/lib -lfreetype -lz -lpng -lz  
TIFF=     -DUSE_TIFF 

# JPEG distribution (raster support for grayscale JPEG images, INPUT ONLY).
JPEG_INC= 
JPEG_LIB= -ljpeg
JPEG=     -DUSE_JPEG

# EPPL7 Support (this activates ERDAS as well) Included in the distribution. Probably the best raster alternative if
# you've got EPPL7 laying around. See http://www.lmic.state.mn.us/ for more information. (RECOMMENDED)
EPPL=     -DUSE_EPPL
EPPL_OBJ= epplib.o

# ESRI SDE Support. You MUST have the SDE Client libraries and include files
# on your system someplace. The actual SDE server you wish to connect to can
# be elsewhere.
SDE=	  
SDE_LIB=  
SDE_INC=  

# Optional OGR Support.  OGC Simple Feature inspired interface for vector
# formats.  See http://gdal.velocet.ca/projects/opengis/
OGR=	  -DUSE_OGR
OGR_LIB=  -L/usr/local/mapserve/lib -lgdal
OGR_INC=  -I/usr/local/mapserve/include
OGR_STATIC= 

# Optional GDAL Support (provides read access to a variety of raster formats)
# See http://www.remotesensing.org/gdal
GDAL=	  -DUSE_GDAL
GDAL_LIB=  -L/usr/local/mapserve/lib -lgdal
GDAL_INC=  -I/usr/local/mapserve/include

# Optional PostGIS Support.  See http://postgis.refractions.net/
POSTGIS=      
POSTGIS_LIB=  
POSTGIS_INC=  

# Optional MyGIS Support.  See http://postgis.refractions.net/
MYGIS=      
MYGIS_LIB=  
MYGIS_INC=  

# Optional ORACLESPATIAL Support. Contact: cabral at cttmar.univali.br
ORACLESPATIAL=
ORACLESPATIAL_LIB=
ORACLESPATIAL_INC=

# Optional MING/SWF/FLASH Support. Contact: assefa at dmsolutions.ca
MING=
MING_LIB=
MING_INC=

# libcurl ... required for WMS/WFS Client Connections
CURL_INC=
CURL_LIB=-L/usr/lib -lcurl -lz -lssl -lcrypto -ldl -lz

# OWS: OGC Web Services support
# OGC WMS Server:  -DUSE_WMS_SVR (Requires PROJ4 support)
# OGC WMS Client Connections:  -DUSE_WMS_LYR (Requires PROJ4 and libcurl)
# OGC WFS Server: -DUSE_WFS_SVR (Requires OGR, PROJ4 recommended)
# OGC WFS Client: -DUSE_WFS_LYR (Requires OGR, PROJ4 and libcurl)
OWS=-DUSE_WMS_SVR -DUSE_WMS_LYR -DUSE_WFS_SVR 

#
# IMPORTANT NOTE ABOUT REGEX FOR PHP_MAPSCRIPT USERS:
#
# In order to compile the PHP_MAPSCRIPT module, we have to make MapServer
# uses the same version of the REGEX library that PHP was compiled with:
#
REGEX_OBJ=
REGEX_INC=

#
# Multithreading support.
#
THREAD=-DUSE_THREAD
THREAD_LIB=-lpthread

#
# Pick a compiler, etc. Flex and bison are only required if you need to modify the mapserver lexer (maplexer.l) or expression parser (mapparser.y).
#
CXX=	g++
CC=     gcc
LD=     gcc
AR= ar rc
RANLIB= ranlib
LEX=    flex
YACC=   bison -y

XTRALIBS=  -lm -lstdc++
RUNPATHS= 

CFLAGS= -O2  -Wall  \
        $(IGNORE_MISSING_DATA) $(STRINGS) $(EPPL) $(PROJ) $(OWS) $(MING) \
	$(ORACLESPATIAL) $(TIFF) $(JPEG) $(GD) $(PDF) $(SDE) $(OGR) $(GDAL) \
	$(POSTGIS) $(MYGIS) $(MPATROL) $(THREAD) \
	$(GD_INC) $(PDF_INC) $(PROJ_INC) $(TIFF_INC) $(JPEG_INC) $(EGIS_INC) $(SDE_INC) \
	$(REGEX_INC) $(MPATROL_INC) $(OGR_INC) $(GDAL_INC) $(POSTGIS_INC) $(MYGIS_INC) \
	$(CURL_INC) $(MING_INC) $(ORACLESPATIAL_INC)

# Link flags and shared libs only
LDFLAGS=  $(RUNPATHS) -L. -lmap $(GD_LIB) $(PDF_LIB) $(TIFF_LIB) $(PROJ_LIB) \
          $(JPEG_LIB) $(SDE_LIB) $(OGR_LIB) $(GDAL_LIB) \
	  $(MING_LIB) $(POSTGIS_LIB) $(MYGIS_LIB) $(CURL_LIB) $(ORACLESPATIAL_LIB) \
	  $(MPATROL_LIB) $(THREAD_LIB) $(XTRALIBS)

# STATIC_LIBS is full filename with path of libs that will be statically linked
STATIC_LIBS= $(GD_STATIC) $(OGR_STATIC)

RM= /bin/rm -f

OBJS= maptemplate.o mapbits.o maphash.o mapshape.o mapxbase.o mapparser.o maplexer.o maptree.o mapsearch.o mapstring.o mapsymbol.o mapfile.o maplegend.o maputil.o mapscale.o mapquery.o maplabel.o maperror.o mapprimitive.o mapproject.o mapraster.o mapsde.o mapogr.o mappostgis.o mapmygis.o maplayer.o mapresample.o mapwms.o mapwmslayer.o maporaclespatial.o mapgml.o mapprojhack.o mapthread.o mapdraw.o mapgd.o mapoutput.o mapgdal.o mapswf.o mapimagemap.o mapows.o mapwfs.o mapwfslayer.o mapcontext.o maphttp.o mapdrawgdal.o mappdf.o mapjoin.o mapgraticule.o mapcopy.o $(EPPL_OBJ) $(REGEX_OBJ)

#
# --- You shouldn't have to edit anything else. ---
#
.c.o:
	$(CC) -c $(CFLAGS) $< -o $@

all: $(MAKE_GD) libmap.a shp2img shp2pdf legend \
	mapserv shptree shptreevis shptreetst scalebar sortshp mapscriptvars \
	tile4ms php3_mapscript

php3_mapscript:: libmap.a
	cd mapscript/php3; $(MAKE); cd ../..

maplexer.o: maplexer.c map.h mapfile.h

maplexer.c: maplexer.l
	$(LEX) -Pmsyy -i -omaplexer.c maplexer.l

mapparser.o: mapparser.c map.h

mapparser.c: mapparser.y
	$(YACC) -p msyy -d -omapparser.c mapparser.y

mapogr.o: mapogr.cpp
	$(CXX) -c $(CFLAGS) mapogr.cpp -o mapogr.o

lib: libmap.a
libmap: libmap.a
libmap.a: map.h $(OBJS) map.h
	$(AR) libmap.a $(OBJS)
	$(RANLIB) libmap.a

shp2pdf: libmap.a shp2pdf.o map.h
	$(LD) $(CFLAGS) shp2pdf.o $(LDFLAGS) $(STATIC_LIBS) -o shp2pdf

shp2img: libmap.a  shp2img.o map.h
	$(LD) $(CFLAGS) shp2img.o $(LDFLAGS) $(STATIC_LIBS) -o shp2img

sym2img: libmap.a   sym2img.o map.h
	$(LD) $(CFLAGS) sym2img.o $(LDFLAGS) $(STATIC_LIBS) -o sym2img

legend: libmap.a  legend.o map.h
	$(LD) $(CFLAGS) legend.o $(LDFLAGS) $(STATIC_LIBS) -o legend

scalebar: libmap.a  scalebar.o map.h
	$(LD) $(CFLAGS) scalebar.o $(LDFLAGS) $(STATIC_LIBS) -o scalebar

mapserv: mapserv.h libmap.a  mapserv.o cgiutil.o map.h
	$(LD) $(CFLAGS) mapserv.o cgiutil.o  $(LDFLAGS) $(STATIC_LIBS) -o mapserv

mapserv.fcgi: mapserv.h libmap.a  mapserv_fcgi.o cgiutil.o map.h
	$(LD) $(CFLAGS) mapserv_fcgi.o cgiutil.o  \
	$(LDFLAGS) $(STATIC_LIBS) -lfcgi \
	 -o mapserv.fcgi

shpindex: libmap.a shpindex.o map.h
	$(LD) $(CFLAGS) shpindex.o $(LDFLAGS) $(STATIC_LIBS) -o shpindex

shptree: libmap.a shptree.o map.h
	$(LD) $(CFLAGS) shptree.o $(LDFLAGS) $(STATIC_LIBS) -o shptree

shptreevis: libmap.a shptreevis.o map.h
	$(LD) $(CFLAGS) shptreevis.o $(LDFLAGS) $(STATIC_LIBS) -o shptreevis

shptreetst: libmap.a shptreetst.o map.h
	$(LD) $(CFLAGS) shptreetst.o $(LDFLAGS) $(STATIC_LIBS) -o shptreetst

sortshp: sortshp.o
	$(LD) $(CFLAGS) sortshp.o $(LDFLAGS) $(STATIC_LIBS) -o sortshp

tile4ms: tile4ms.o
	$(LD) $(CFLAGS) tile4ms.o $(LDFLAGS) $(STATIC_LIBS) -o tile4ms

testexpr: testexpr.o mapparser.o maplexer.o
	$(LD) $(CFLAGS) testexpr.o $(LDFLAGS) $(STATIC_LIBS) -o testexpr

mapscriptvars:
	touch mapscriptvars
	pwd > mapscriptvars
	echo $(IGNORE_MISSING_DATA) $(STRINGS) $(EPPL) $(PROJ) $(TTF) $(TIFF) $(JPEG) $(GD) $(SDE) $(OGR) $(GDAL) >> mapscriptvars
	echo -I. $(PROJ_INC) $(GD_INC) $(TTF_INC) $(TIFF_INC) $(JPEG_INC) $(SDE_INC) $(OGR_INC) $(GDAL_INC) >> mapscriptvars
	echo $(LDFLAGS) >> mapscriptvars
	echo $(STATIC_LIBS) >> mapscriptvars

php3_mapscript_clean::
	cd mapscript/php3; $(MAKE) clean; cd ../..

install:
	@echo ""
	@echo "***** MapServer Installation *****"
	@echo "To install MapServer, copy the 'mapserv' file to your web server's cgi-bin "
	@echo "directory."
	@echo "If you use MapScript then see the documentation for your specific MapScript"
	@echo "version for installation instructions."
	@echo ""

clean: php3_mapscript_clean
	rm -f libmap.a *.o shp2img shp2pdf mapserv legend shptree shptreevis shptreetst scalebar sortshp mapscriptvars tile4ms testexpr

distclean:
	$(MAKE) clean
	rm config.*

sorta-clean:
	rm -f *.o


Pericles S. Nacionales wrote:

>Andrew,
>
>Have a look at your Apache error_log.  Chances are some of your
>libraries are not being seen by MapServer.  If this is the case and
>assuming you have installed the libraries you compiled in "/usr/local/",
>run the command "/sbin/ldconfig" as root to create/refresh the links to
>your libraries.  You can then run "/sbin/ldconfig -p | more" to check
>that the libraries needed by MapServer are "registered".  If they're
>not, edit /etc/ld.so.conf as root and add "/usr/local/lib" (or wherever
>you installed your libraries).  You can then rerun "/sbin/ldconfig" and
>your problems should go away.
>
>One caveat:  There may be reasons not to add "/usr/local/lib" to your
>ld.so.conf file.  You might have duplicate libraries that could screw
>other things.
>
>Good luck!
>-Perry N.
>
>On Fri, 2004-04-16 at 13:32, Andrew wrote:
>  
>
>>I have converted all my tiff files to png, renamed all the .tfw world 
>>files with a .wld extension, and I can get png files to display (albeit 
>>not to the necessary scale or projection necessarily). My mapserv "says" 
>>it supports tiff input, and the gdal conversions from tiff to png and 
>>back work fine. I still get the "premature end of script headers" when I 
>>use tiffs. The wms connection still fails, but the same tiff file saved 
>>locally and used in place still causes the cgi to abort.
>>
>>Is there a simple algorithm or technique to use to georeference the png 
>>files made from the tiff files so I can use the world files directly? 
>>What is the best workaround, if the tiff support remains broken? Is 
>>there a known "fix"?
>>
>>Thanks
>>
>>_______________________________________________
>>Mapserver-users mailing list
>>Mapserver-users at lists.gis.umn.edu
>>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>>    
>>
>
>_______________________________________________
>Mapserver-users mailing list
>Mapserver-users at lists.gis.umn.edu
>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
>  
>





More information about the mapserver-users mailing list