Need for msInit() and msFinish()...

Sean Gillies sgillies at FRII.COM
Mon Feb 13 09:31:37 EST 2006


On Feb 13, 2006, at 6:59 AM, Frank Warmerdam wrote:

> Steve Lime wrote:
>> Hi all: I'll looking at porting mapgeos.cpp to use the GEOS C API and
>> it looks to me like we'll need an msInit() and msFinish() for use  
>> in the
>> C code and more importantly MapScript. The GEOS C library requires
>> initialization and cleanup. We get around it know by maintianing a  
>> global
>> GeometryFactory and leaking a few bytes. That doesn't look to be  
>> possible
>> or desireable with the C API.
>
> Steve,
>
> Note, there is already an msCleanup() that scrubs up GDAL/OGR and
> a few other things. So the msFinish() should be able to go there.
> Can you avoid msInit() by having the geos interface do the  
> initialization
> the first time it is entered?
>
> I wonder if we are going to have any conflicts with GDAL/OGR also  
> doing
> GEOS init/cleanup stuff.
>
>> Hence the need. We could hide calls in the mapfile load/free code,  
>> but there are some cases where MapScript scripts don't need a  
>> mapfile so we'd need to expose 'em for those cases.
>
> I don't think we ought to cleanup geos just because a mapfile is
> destroyed.  And of course sometimes we use many maps in a single
> run.
>

I'm reminded that we also already have a msSetup() function that is  
used by mapscript.

Sean



More information about the mapserver-dev mailing list