Swig and contructor overloading...

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Wed Nov 2 22:58:27 EST 2005


Why not do something like PostGIS and create a functions like:

shapeObjFromWKT(char *wkt)
WKTFromShapeObj(shapeObj *shape)

-Steve W.

Steve Lime wrote:
> Hi all: Frank and I added some WKT support to MapServer 4.7/8 this
> past weekend. I updated the Swig interface file for the shapeObj
> (shape.i) and added a second parameter to the shapeObj constructor.
> It now looks like:
> 
> shapeObj(int type=MS_SHAPE_NULL, char *wkt=NULL)
> 
> Ideally you'd be able to create a shape with one or the other. Sean
> tells me this will be problematic for Java and C# based Swig modules
> because they don't handle default values. This change will break
> scripts then. Does anyone know if this is still true in the newest
> version of Swig? I know they did some work to standardize things
> across all languages recently. If this will be problem, then we have
> to address it. We could just tackle it with documentation since those
> bindings are not yet as popular. We could move creation from WKT into
> a seperate method. Or?
> 
> Note that WKT reading/writing requires either OGR or GEOS support.
> 
> Steve
> 



More information about the mapserver-dev mailing list