[mapserver-dev] Weak-ass, Potentially Dangerous Fix for Mapscript WKT Errors

Daniel Morissette dmorissette at mapgears.com
Sat Sep 19 12:50:30 EDT 2009


Thanks for the additional info. I have added it to the ticket and 
reassigned it to Alan to look into this for the 5.6 release.

Daniel


Dan Little wrote:
> http://trac.osgeo.org/mapserver/ticket/2763
> 
> I actually have seen this problem rear it's ugly head in Python on a number of applications.  It seems specifically linked to 64-bit platforms as my old Pentium 4 didn't seem to have the same issues.
> 
> Now, what I've done is a hack... I don't expect it to be anything more but it has fixed my issues...
> 
> In mapgeos.c ... comment out the msGEOSFreeGeomtry line.  I'm not sure how msGEOSFreeGeometry updates the geometry as according to the comments.   I just followed the line of logic from GDB, commented out some code, and magically things started to work as expected.
> 
> char *msGEOSShapeToWKT(shapeObj *shape)
> {
> #ifdef USE_GEOS
>   GEOSGeom g;
> 
>   if(!shape)
>     return NULL;
> 
>   /* if we have a geometry, we should update it*/
>   /* msGEOSFreeGeometry(shape->geometry); */
> 
>   shape->geometry = (GEOSGeom) msGEOSShape2Geometry(shape);
>   g = (GEOSGeom) shape->geometry;
>   if(!g) return NULL;
> 
>   return GEOSGeomToWKT(g);
> #else
>   msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSShapeToWKT()");
>   return NULL;
> #endif
> }
> 
> My hope is that someone with a little more free time and effort may be able either confirm this is a real fix (doubt it) or find the real fix with more familiarity to the msGEOS* code base.
> 
> -Duck
> 
> 
> 
>       
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev


-- 
Daniel Morissette
http://www.mapgears.com/


More information about the mapserver-dev mailing list