SWIGMapscript: processLegendTemplate throws error

Sean Gillies sgillies at FRII.COM
Wed Dec 15 07:36:59 PST 2004


On Dec 15, 2004, at 12:49 AM, Umberto Nicoletti wrote:

> --=-J2DZuAKnD/5NuQhhNysL
> Content-Type: text/plain
> Content-Transfer-Encoding: 7bit
>
> On Mon, 2004-12-13 at 10:16 -0700, Sean Gillies wrote:
>> Can you not try and catch, and pass in the case of an exception?
>> This is essentially what happens with shp2pdf.
>>
>
> I have modified the DrawMap example as follows:
>
> mapObj map = new mapObj(args[0]);
>     map.getImagecolor().setRGB(153, 153, 204);
>     styleObj st = map.getLayer(1).getClass(0).getStyle(0);
>     st.getColor().setHex("#000000");
>     outputFormatObj pdf=new outputFormatObj("pdf","pdf");
>     //outputFormatObj flash=new outputFormatObj("SWF","swf");
>     imageObj img=null;
>     try {
>     map.setOutputFormat(pdf);
>     //map.setOutputFormat(flash);
>     //map.getScalebar().setStatus(mapscript.MS_OFF);
>     System.out.println("Scalebar status:
> "+map.getScalebar().getStatus());
>     img = map.draw();
>     System.out.println("The map will be drawn to:"+args[1]);
>     } catch(Throwable e) {
>     }
>     img.save(args[1], map);
>
> but, as I suspected it does not work because draw() does not return and
> img is therefore null.
> I attach a patch for this PDF specific error. Let me know if you like
> it
> or if we should work it out differently.
>
> Regards,
> Umberto
>

You are catching an error, but what is it?

I'm not going to do anything about the PDF patch.  Please create
an new issue in the MapServer Bugzilla and attach the patch to
that issue.  Then the PDF output format maintainer can address it
properly.

At any rate, this thread is decomposing.  Started out about templates
and is now PDF?  To continue the discussion I think we should start
over.

cheers,
Sean



More information about the MapServer-users mailing list