[gradsusr] Memory Allocation Error When Using PRINTIM

Jennifer Adams jma at cola.iges.org
Fri Dec 3 14:08:27 EST 2010


On Dec 3, 2010, at 12:13 AM, Stephen McMillan wrote:

> As long as I used "admin98 2342" instead of  "ln_ak" for the Alaska  
> shapefile, I'm able to PRINTIM the image without the memory  
> allocation error.
Correct. The ln_ak shapefile is the trouble maker. That shapefile has  
a polygon in it with 60083 vertices, and that number is encoded into  
the metafile buffer as a short (not an int) which is not big enough to  
store such a (relatively) large integer. As I suspected, the malloc  
call in the printim code is getting passed junk (-5453) and that is  
why you are getting the error.

Unfortunately, we will not be tinkering with the metafile buffer  
format in version 2.0. The fix for this bug will have to wait until we  
release GrADS 2.1, which will have a new graphics rendering library  
(cairo) behind it that will force significant changes to the metafile,  
which will probably only exist in memory. I'm glad you have a  
reasonable work-around solution.

By the way, if you 'set line 1' and 'set shpopts 2', the 'draw shp'  
command will draw the shapefile polygons filled in with color 2 and  
outlined in color 1 -- it is not necessary to call 'draw shp' twice,  
once for the fill and once for the outline.

--Jennifer


> We can put this one to rest (a collective sigh out there...).
I think it is safe to say that NOW this issue has been resolved.






More information about the gradsusr mailing list