[mapserver-users] Python Mapscript MS 3.6.1

Norman Vine nhv at cape.com
Thu Jul 11 10:19:13 PDT 2002


Michael Schulz writes:
>
>thanks for the hint to the setup script of Norman Vine. Find it here:
>http://www.vso.cape.com/~nhv/files/python/mapscript/setup.py )
>You may need to change some things (paths, libs, etc. ).
>
>It works well and python gets swigged and compiled and
>installed automatically. Yipiie!
>
>But after that i encountered some problems. After invoking
>python, i can do:
>
>>>>import mapscript      (works fine), then i try a test that
>Norman mentioned in a post:
>>>>mapscript.msGetVersion()      (should give the MS_VERSION
>string) but i get this error:
>AttributeError: 'mapscript' module has no attribute 'msGetVersion'
>>>>m = mapscript.ms_newmapObj('/path/to/mapfile')
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>AttributeError: 'mapscript' module has no attribute 'ms_newmapObj'
>
>So, it seems i get mapscript compiled and all, but it is not
>working properly.
>(I am using MS 3.6.0, Python 2.1.2, Swig 1.3.13)

Michael

The mapscript API keeps changing !!
Both of the above calls no longer exist.

FYI

Here is what I get from a version of mapscript compiled
after a very recent CVS update

Cheers

Norman

$ python
Python 2.1.1 (#44, Feb 17 2002, 12:51:44)
[GCC 2.95.3-5 (cygwin special)] on cygwin
Type "copyright", "credits" or "license" for more information.
>>> import mapscript
>>> dir()
['__builtins__', '__doc__', '__name__', 'mapscript']
>>> dir(mapscript)
['DBFInfo', 'DBFInfoPtr', 'FTDouble', 'FTInteger', 'FTInvalid', 'FTString',
'GetMapserverUnitUsingProj', 'MS_AUTO', 'MS_BITMAP',
'MS_CC', 'MS_CJC_BEVEL', 'MS_CJC_BUTT', 'MS_CJC_MITER', 'MS_CJC_NONE',
'MS_CJC_ROUND', 'MS_CJC_SQUARE',
'MS_CJC_TRIANGLE', 'MS_CL', 'MS_CR', 'MS_DD', 'MS_DEFAULT', 'MS_DELETE',
'MS_DONE', 'MS_EMBED', 'MS_FAILURE', 'MS_FALSE', 'MS_FEET', 'MS_FILE_MAP',
'MS_FILE_SYMBOL', 'MS_GIANT', 'MS_HILITE', 'MS_IMAGEMODE_FLOAT32',
'MS_IMAGEMODE_INT16', 'MS_IMAGEMODE_PC256', 'MS_IMAGEMODE_RGB',
'MS_IMAGEMODE_RGBA', 'MS_INCHES',
'MS_INLINE', 'MS_KILOMETERS', 'MS_LARGE', 'MS_LAYER_ANNOTATION',
'MS_LAYER_CIRCLE', 'MS_LAYER_LINE', 'MS_LAYER_POINT', 'MS_LAYER_POLYGON',
'MS_LAYER_QUERY', 'MS_LAYER_RASTER', 'MS_LC', 'MS_LL', 'MS_LR',
'MS_MEDIUM', 'MS_METERS', 'MS_MILES', 'MS_MULTIPLE', 'MS_NO',
'MS_NOOVERRIDE', 'MS_NORMAL',
 'MS_OFF', 'MS_OGR', 'MS_ON', 'MS_ORACLESPATIAL', 'MS_PIXELS', 'MS_POSTGIS',
'MS_SDE', 'MS_SELECTED',
'MS_SHAPEFILE', 'MS_SHAPEFILE_ARC', 'MS_SHAPEFILE_MULTIPOINT',
'MS_SHAPEFILE_POINT', 'MS_SHAPEFILE_POLYGON', 'MS_SHAPE_LINE',
'MS_SHAPE_NULL', 'MS_SHAPE_POINT', 'MS_SHAPE_POLYGON', 'MS_SHP_ARCM',
'MS_SHP_MULTIPOINTM', 'MS_SHP_POINTM', 'MS_SHP_POLYGONM', 'MS_SINGLE',
'MS_SMALL', 'MS_SUCCESS', 'MS_TILED_SHAPEFILE', 'MS_TINY', 'MS_TRUE',
'MS_TRUETYPE', 'MS_UC', 'MS_UL', 'MS_UNUS
ED_1', 'MS_UR', 'MS_VERSION', 'MS_WMS', 'MS_XY', 'MS_YES', '__builtins__',
'__doc__', '__file__', '__name__', '__path__',
'classObj', 'classObjPtr', 'colorObj', 'colorObjPtr', 'imageObj',
'imageObjPtr', 'itemObj', 'itemObjPtr', 'labelCacheMemberObj',
'labelCacheMemberObjPtr', 'labelCacheObj', 'labelCacheObjPtr', 'labelObj',
'labelObjPtr', 'layerObj', 'layerObjPtr', 'legendObj',
'legendObjPtr', 'lineObj', 'lineObjPtr', 'mapObj', 'mapObjPtr', 'mapscript',
'mapscriptc', 'markerCacheMemberObj',
'markerCacheMemberObjPtr', 'msDBFAddField', 'msDBFClose', 'msDBFCreate',
'msDBFGetFieldCount', 'msDBFGetFieldInfo', 'msDBFGetItemIndex',
'msDBFGetItemIndexes', 'msDBFGetItems', 'msDBFGetRecordCount',
'msDBFGetValueList', 'msDBFGetValues', 'msDBFOpen',
'msDBFReadDoubleAttribute', 'msDBFReadIntegerAttribute',
'msDBFReadStringAttribute', 'msDBFWriteDoubleAttribute',
'msDBFWriteIntegerAttribute', 'msDBFWriteStringAttribute', 'msFreeImage',
'msSaveImage', 'outputFormatObj',
'outputFormatObjPtr', 'pointObj', 'pointObjPtr', 'projectionObj',
'projectionObjPtr', 'queryMapObj', 'queryMapObjPtr',
'rectObj', 'rectObjPtr', 'referenceMapObj', 'referenceMapObjPtr',
'resultCacheMemberObj', 'resultCacheMemberObj
Ptr', 'resultCacheObj', 'resultCacheObjPtr', 'scalebarObj',
'scalebarObjPtr', 'shapeObj', 'shapeObjPtr', 'shapefileObj',
 'shapefileObjPtr', 'styleObj', 'styleObjPtr', 'webObj', 'webObjPtr']
>>>


==========

$ swig -version

SWIG Version 1.3.13u-20020628-1621
Copyright (c) 1995-1998
University of Utah and the Regents of the University of California
Copyright (c) 1998-2001
University of Chicago

Compiled with CC




More information about the MapServer-users mailing list