[gradsusr] Critical bug: "Memory allocation error: gxhpng" when drawing shapefiles

Stefan Gofferje stefan at saakeskus.fi
Sat May 25 10:14:39 EDT 2013


Hi,

I had a HD crash in my server which killed the directory where I had the
shapefiles. I downloaded all shapefiles again (from DIVA and natural
earth), put them in another folder, modified the rendering script
accordingly but now I don't get any shapes any more. The plot is
outputted with everything that's plotted, just the shapefile information
is missing. (s. http://www.saakeskus.fi/24h-precipitation-forecast#top).
The log shows only that error "Memory allocation error: gxhpng" after
each plot.

The script that draws the maps is attached. Normally, I use it like this:

'run sg_shapemap finland1'
...
plot all kinds of stuff
...
'run sg_shapemap finland2'
'printim '_webdir'/filename.png '_imagesize' -f '_stamp


>From what is going on, my guess would be that something has changed in
the shapefiles that grads can't deal with anymore.
For me that's a disaster because it breaks the most popular charts in my
website.
I already upgraded from 2.0.0 to 2.0.2. My rendering system has 8GB RAM
of which is most unused, sop it shouldn't be that.

ANY kind of help would be very welcome because now the stormchasing
season has started and my most popular and most useful charts are gone...

Greets,
Stefan
-------------- next part --------------
function map(arg)

if (arg = '')
   'quit'
else
   cmdline=arg
endif

*_shapedir='/raid/webserver/saakeskus.fi/shapefiles'
_shapedir='/server/saakeskus/shapefiles'

map=subwrd(cmdline,1)

'set parea 0 8.50 0 11'
'set frame off'

if (map = 'finland1')
  'clear'
  'set mproj nps'
  'set mpvals 17.6 34.65 59 70.5'
  'set lon 0 60'
  'set lat 55 80'
  'set grid off'
  'set mpdraw off'
  'set grads off'
  'set gxout contour'
  'set xlab off'
  'set ylab off'
  'set clevs 0'
  'd tmp2m'
  
  'set shpopts 33'
  'set line 33 1 1'
  'draw shp '_shapedir'/ne_10m_ocean'
  'set shpopts 35'
  'set line 35'
  'draw shp '_shapedir'/ne_10m_land'
  'set shpopts 33'
  'set line 33'
  'draw shp '_shapedir'/FIN_water_areas_dcw'
  'draw shp '_shapedir'/FIN_water_lines_dcw'
endif

if (map = 'finland2')
  'set lon 0 60'
  'set lat 55 80'
  'set shpopts -1'
  'set line 98'
  'draw shp '_shapedir'/ne_10m_admin_0_countries'
  'draw shp '_shapedir'/ne_10m_admin_1_states_provinces_shp'
  'set shpopts 111'
  'set line 111'
  'draw shp '_shapedir'/ne_10m_urban_areas'
  'set string 98 l 1'
  'run sg_drawcities_nostar'
endif

if (map = 'finwcoast1')
  'clear'
  'set mproj nps'
  'set mpvals 19.1 27.1 58.9 64.29'
  'set lon 0 60'
  'set lat 55 80'
  'set grid off'
  'set mpdraw off'
  'set grads off'
  'set gxout contour'
  'set xlab off'
  'set ylab off'
  'set clevs 0'
  'd tmp2m'
  
  'set shpopts 33'
  'set line 33 1 1'
  'draw shp '_shapedir'/ne_10m_ocean'
  'set shpopts 35'
  'set line 98'
  'draw shp '_shapedir'/ne_10m_land'
  'draw shp '_shapedir'/ne_10m_minor_islands'
  'set shpopts 33'
  'set line 33'
  'draw shp '_shapedir'/FIN_water_areas_dcw'
  'draw shp '_shapedir'/FIN_water_lines_dcw'
endif

if (map = 'finwcoast2')
  'set lon 0 60'
  'set lat 55 80'
  'set shpopts -1'
  'set line 98'
  'draw shp '_shapedir'/ne_10m_admin_0_countries'
  'set shpopts 111'
  'set line 111'
  'draw shp '_shapedir'/ne_10m_urban_areas'
  'set string 98 l 1'
  'run sg_drawcities_nostar'
endif

if (map = 'germany1')
  'clear'
  'set mproj nps'
  'set mpvals 4.05 15.6 46.5 57'
  'set lon 0 60'
  'set lat 45 80'
  'set grid off'
  'set mpdraw off'
  'set grads off'
  'set gxout contour'
  'set xlab off'
  'set ylab off'
  'set clevs 0'
  'd tmp2m'
  
  'set shpopts 33'
  'set line 33 1 1'
  'draw shp '_shapedir'/ne_10m_ocean'
  'set shpopts 35'
  'set line 35'
  'draw shp '_shapedir'/ne_10m_land'
  'set shpopts 33'
  'set line 33'
  'draw shp '_shapedir'/DEU_water_areas_dcw'
  'draw shp '_shapedir'/DEU_water_lines_dcw'
endif

if (map = 'germany2')
  'set lon 0 60'
  'set lat 45 80'
  'set shpopts -1'
  'set line 108'
  'draw shp '_shapedir'/ne_10m_admin_1_states_provinces_shp'
  'set line 98'
  'draw shp '_shapedir'/ne_10m_admin_0_countries'
  'set string 98 l 1'
  'run sg_drawcities_nostar'
endif



More information about the gradsusr mailing list