[Mapserver-users] python mapscript install 3.7

Norman Norman
Wed Jan 29 13:01:04 EST 2003


Michael Schulz writes:
> 
> i have a problem when trying to compile mapserver 3.7 / mapscript for
> python (from the nightly.tar.gz). With the newly included setup.py
> everything works very smooth, mapserver has compiled fine, mapscript
> compilation with some warnings, but when i try to import mapscript in
> python i get this error:
> 
> Python 2.1.2 (#11, Jul 11 2002, 15:03:40)
> >>> import mapscript
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/local/lib/python2.1/site-packages/mapscript.py", line 4, in
> ?
>     import _mapscript
> ImportError: undefined symbol: msAddColor
> 
> Hmm, is this related to the change from mapObj.addColor() to setRGB()?

FYI

I have to make the following changes to mapscript.i
inorder to get a working Python mapscript from the 
CVS sources

I have needed to do this for a while

Below I believe

 int contrain(rectObj *bounds, double overlay) {
    return msConstrainRect(bounds,self, overlay);
  }

should be

 int contsrain(rectObj *bounds, double overlay) {
    return msConstrainExtent(bounds,self, overlay);
  }

Not sure about the others

Norman


$ cvs diff -cw mapscript.i
Index: mapscript.i
===================================================================
RCS file: /data2/cvsroot/mapserver/mapscript/mapscript.i,v
retrieving revision 1.90
diff -c -w -r1.90 mapscript.i
*** mapscript.i 27 Jan 2003 22:38:42 -0000      1.90
--- mapscript.i 29 Jan 2003 17:46:27 -0000
***************
*** 102,110 ****
        return NULL;
    }

!   int addColor(int r, int g, int b) {
!     return msAddColor(self, r, g, b);
!   }

    int getSymbolByName(char *name) {
      return msGetSymbolIndex(&self->symbolset, name);
--- 102,110 ----
        return NULL;
    }

! //  int addColor(int r, int g, int b) {
! //    return msAddColor(self, r, g, b);
! //  }

    int getSymbolByName(char *name) {
      return msGetSymbolIndex(&self->symbolset, name);
***************
*** 136,146 ****
      }


!     if (MS_DRIVER_GD(self->outputformat))
!     {
!         if(msLoadPalette(image->img.gd, &(self->palette), self->imagecolor) == -1)
!           return NULL;
!     }
      self->cellsize = msAdjustExtent(&(self->extent), self->width, self->height);
      status = msCalculateScale(self->extent, self->units, self->width, self->height, self->resolution, &self->scale);
      if(status != MS_SUCCESS) return NULL;
--- 136,146 ----
      }


! //    if (MS_DRIVER_GD(self->outputformat))
! //    {
! //        if(msLoadPalette(image->img.gd, &(self->palette), self->imagecolor) == -1)
! //          return NULL;
! //    }
      self->cellsize = msAdjustExtent(&(self->extent), self->width, self->height);
      status = msCalculateScale(self->extent, self->units, self->width, self->height, self->resolution, &self->scale);
      if(status != MS_SUCCESS) return NULL;
***************
*** 754,762 ****
      return  msAdjustExtent(self, width, height);
    }

!   int contrain(rectObj *bounds, double overlay) {
!     return msConstrainRect(bounds,self, overlay);
!   }

    int draw(mapObj *map, layerObj *layer, imageObj *image, int classindex, char *text) {
      shapeObj shape;
--- 754,762 ----
      return  msAdjustExtent(self, width, height);
    }

! //  int contrain(rectObj *bounds, double overlay) {
! //    return msConstrainRect(bounds,self, overlay);
! //  }

    int draw(mapObj *map, layerObj *layer, imageObj *image, int classindex, char *text) {
      shapeObj shape;




More information about the mapserver-users mailing list