[Mapserver-users] Python/Mapscript

Sean Gillies sgillies at frii.com
Fri Jul 11 13:35:05 EDT 2003


On Friday, July 11, 2003, at 10:59  AM, Paul Dymecki wrote:

> Hi Sean,
>    I've imported Michael's mapscript binaries, with no errors.  I was
> wondering if there's a quick way of testing if it's working?  Should i
> download Zoap mapserver?
> thx,
> Paul

Paul,

Do you have a map file that you know and trust?  If so, launch
a python interpreter either from the NT command line or use
pythonwin.exe and start playing with the module.  My example
before is in a bash shell, but you'll get the picture.

bash-2.05a$ python2.1
Python 2.1.3 (#18, Jun 24 2003, 18:02:42)
[GCC 3.1 20020420 (prerelease)] on darwin6
Type "copyright", "credits" or "license" for more information.
 >>> from mapscript import *
 >>> mapobj = mapObj('/Users/sean/Projects/ZMapServer/demo/demo.map')
 >>> mapobj.name
'demo'
 >>> mapobj.getMetaData('WMS_SRS')
'EPSG:26915'
 >>> mapobj.getMetaData('WMS_TITLE')
'UMN MapServer Itasca Demo'
 >>> mapobj.getProjection()
'init=epsg:26915'
 >>> imgobj = mapobj.draw()
 >>> imgobj.save('/tmp/test.png')

Being able to work with MapScript interactively as well as
programmatically is awesome.  Do Perl/PHP map users know what they
are missing?

If you need more help with the PyIMS Facade or ZMapServer, please
email me directly so we don't clutter the list.

cheers,
Sean
--
Sean Gillies
sgillies at frii dot com
http://www.frii.com/~sgillies




More information about the mapserver-users mailing list