[gradsusr] shape files and printim: memory allocation error

Sergey Varlamov vsm at jamstec.go.jp
Wed May 2 04:03:39 EDT 2012


Dear GrADS users,

If some of you is interested in saving your images with
the large FILLED POLYGONS from the shape files
using the GrADS printim command or other GrADS utilities
that parse the metafile content, it could be fixed.

You have to modify source code to get it working.
Problem is that the filled polygon size
is saved in the metafile/buffer as C short int  (<32765).
The real filled polygon sizes in the shape files like Japan outline
(JPN_adm0.shp) are much larger. The solution I used was to save/write
the filled polygon size in the metafile buffer using two short numbers
instead of one at the write/save stage and restore it on the read/parse
stage.

Have to modify code in:
gxmeta.c
gxsubs.c
gxhpng.c

and the code of related utilities:
gxeps.c
gxps.c
gxgif.c
gxtran.c (this one has one more problem that the buffer
size is statically fixed and could be small in some cases...)

For me now printim works without problem.
Who is interested to get modified code please e-mail me
and I'll send you the modified files.

Sincerely yours,
Sergey Varlamov


Sergey Varlamov wrote:
> Dear GrADS users,
>
> Have somebody met a problem with printim that an attempt to save
> grads image that includes FILLED poligon constructed using shape files
> permanently results in the memory allocation error: gxhpng?
>
> I am running GrADS 2.0.1 build from the source
> on openSUSE linux computer. No problems when
> the fillcolor is not set, but regular error with the filled
> shapes...
>
> Would be very thankful for any solution or patch!
>
> Sergey Varlamov
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>   


-- 

Sergey Varlamov

Senior Scientist
Ocean Downscaled Prediction Research Team
Climate Variation Predictability and Applicability Research Program
Research Institute for Global Change
JAMSTEC, 3173-25 Showa-machi, Kanazawa-ku,
Yokohama, Kanagawa-ken, 236-0001 JAPAN
Tel: +81-45-778-5516  Fax: +81-45-778-5707
E-mail: vsm at jamstec.go.jp

〒236-0001 横浜市金沢区昭和町3173-25
独立行政法人海洋研究開発機構 地球環境変動領域
短期気候変動応用予測研究プログラム
ダウンスケール沿海変動予測研究チーム
Varlamov Sergey





More information about the gradsusr mailing list