[mapserver-users] python mapscript AGG problem
Guillaume Sueur
no-reply at neogeo-online.net
Tue Apr 21 07:54:17 EDT 2009
Yes, you can, by compiling your own version of MapServer including agg
support and running setup.py install from mapscript/python directory.
But you'll run into agg static lib problem, that you can fix following
the included instructions from PerryGeo (http://www.perrygeo.net/wordpress/)
Best regards,
Guillaume
dzizes a écrit :
> I know that its not proper. It is standard one which goes with default
> linux package.
> I'm wandering if there is a way for upgrading python mapscript module
> with reference to AGG library.
>
> --
> Michał
>
>
> On Tue, Apr 21, 2009 at 12:38 PM, Guillaume Sueur
> <no-reply at neogeo-online.net <mailto:no-reply at neogeo-online.net>> wrote:
>
> Hi,
>
> I guess that the mapscript you are using with python is not the proper
> one. Did you go to mapserver/mapscript/python and run setup.py install ?
>
> Note that integration of agg in python-mapscript is not trivial due to
> some limitations in the agg lib.
>
> regards
>
> Guillaume
>
> dzizes a écrit :
> > HEllo!
> >
> > I've compiled mapserver against AGG on linux. My web application
> that works
> > with mapserver renders nice images with the use of AGG library.
> >
> > /usr/lib/cgi-bin$ ./mapserv -v
> > MapServer version 5.2.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
> > OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV
> > SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_CLIENT
> SUPPORTS=FASTCGI
> > SUPPORTS=THREADS INPUT=TIFF INPUT=EPPL7 INPUT=ORACLESPATIAL INPUT=OGR
> > INPUT=GDAL INPUT=SHAPEFILE
> >
> >
> > However, when I try to open simple mapfile with mapscript - python
> craches.
> >
> > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
> > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import mapscript
> >>>> m = mapscript.mapObj('/tmp/test.map')
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in <module>
> > File "/usr/lib/python2.5/site-packages/mapscript.py", line 1267, in
> > __init__
> > this = _mapscript.new_mapObj(*args)
> > _mapscript.MapServerError: loadOutputFormat(): General error message.
> > OUTPUTFORMAT clause references driver AGG/PNG, but this driver isn't
> > configured.
> >
> > # mapfile output specification
> > OUTPUTFORMAT
> > NAME png
> > DRIVER "AGG/PNG"
> > MIMETYPE "image/png"
> > IMAGEMODE RGB
> > EXTENSION "png"
> >
> > FORMATOPTION "TRANSPARENT=ON"
> > FORMATOPTION "INTERLACE=OFF"
> > FORMATOPTION "QUANTIZE_FORCE=OFF"
> > END
> >
> > Any ideas what might be wrong?
> >
> >
>
>
-------------- next part --------------
# agg
#agg 2.4
# based on http://trac.osgeo.org/mapserver/ticket/2215
tar -xzvf agg2.4.tar.gz
cd agg2.4
emacs src/Makefile
# add to CXXFLAGS ... -fPIC
CXXFLAGS= $(AGGCXXFLAGS) -I../include -L./ -fPIC
# add to the end of file
make
cd examples/X11
emacs Makefile
# Change:
# -I/usr/local/include/freetype2 \
# To:
# `freetype-config --cflags` \
# add to both CXXFLAGS ...... -fPIC
######
CXXFLAGS= $(AGGCXXFLAGS) -I../../include \
-L../../src \
$(PIXFMT) -fPIC
CXXFREETYPEFLAGS= $(AGGCXXFLAGS) -Wall \
-I../../include \
-I../../font_freetype \
`freetype-config --cflags` \
-L../../src \
$(PIXFMT) -fPIC
######
make freetype
cd ../../font_freetype/
ar r libaggfontfreetype.a agg_font_freetype.o
cd ../src
ln -s ../font_freetype/libaggfontfreetype.a
cd ..
make clean
make
cd src
make shared
sudo cp libagg.so /usr/local/lib
sudo ldconfig
# mapserver
./configure --without-tiff --with-jpeg --with-png --with-freetype \
--with-zlib --with-threads --with-proj \
--with-gdal=/usr/local/bin/gdal-config --with-wcs --with-ogr \
--with-wmsclient --with-wfsclient --with-wfs \
--without-pdf --with-geos --enable-debug --with-agg=/home/perry/src/agg-2.4 \
--with-postgis=/usr/bin/pg_config \
--with-curl-config=/usr/bin/curl-config --with-httpd=/usr/sbin/apache2 --with-gd=/usr/local \
--with-fastcgi
make
sudo cp mapserv /usr/lib/cgi-bin/
sudo cp shp2img shp2pdf shptree shptreetst shptreevis sortshp tile4ms scalebar legend msencrypt mapserv /usr/local/bin/
#mapscript
cd mapscript/python
# swig -python -shadow -modern -o mapscript_wrap.c ../mapscript.i
swig -python -shadow -modern -templatereduce -fastdispatch -fvirtual -fastproxy \
-modernargs -castmode -dirvtable -fastinit -fastquery -noproxydel -nobuildnone \
-o mapscript_wrap.c ../mapscript.i
python setup.py build
cd tests/cases && python runalltests.py -v
# don't worry about the 4 test failures .. due to postgres database not being present
cd ../..
sudo python setup.py install --force
More information about the mapserver-users
mailing list