Questions about mapserver C API 'projectionObj_new' replacement

pw p.willis at TELUS.NET
Wed Mar 28 17:06:05 EDT 2007


Frank Warmerdam wrote:
> 
> Peter,
> 
> Perhaps that was a local addition?  There does not seem to be a
> creator method for projectionObj.  I think the creator code in
> mapscript/swiginc/projection.i pretty much shows the steps expected.
> 
>         int status;
>         projectionObj *proj=NULL;
> 
>         proj = (projectionObj *)malloc(sizeof(projectionObj));
>         if (!proj) return NULL;
>         msInitProjection(proj);
> 
>         status = msLoadProjectionString(proj, proj4);
>         if (status == -1) {
>             msFreeProjection(proj);
>             free(proj);
>             return NULL;
>         }
> 
>         return proj;
> 
> This is an example of the fact that the "C API" in MapServer is a byproduct
> of internal use rather than careful planning for external developers.
> 



Thanks Frank,

I will be modifying my code to use the API properly within the next
few weeks. Everything compiles fine now, the hitch is that I am using
the PHP mapscript sources incorrectly as a temporary fudge to make my 
original (**NON** php mapscript) 'C' code work.

Best regards,

Peter



More information about the mapserver-dev mailing list