Opened 19 years ago

Last modified 18 years ago

#1371 new enhancement

Perl typemaps for image->write & map->process

Reported by: lfilak@… Owned by: sdlime
Priority: high Milestone:
Component: MapScript-SWIG Version: 4.6
Severity: minor Keywords:
Cc:

Description

SWIG typemaps required for the image->write, map->processTemplate,
map->processLegendTemplate, & map->processQueryTemplate to work in PerlMapScript.
A patch file, currently for 4.4.2, will be attached and then for 4.6.0-beta3 as
soon as available.

Attachments (9)

medina1.patch (10.0 KB ) - added by lfilak@… 19 years ago.
4.4.2 typemap patch
4.6.1_typemap.patch.gz (2.9 KB ) - added by lfilak@… 19 years ago.
Patch for 4.6.1 for image->write & map->processXtemplate
mapscript.patch (9.2 KB ) - added by lfilak@… 18 years ago.
Same as before just not gzip'd
nonwrite.cgi (2.2 KB ) - added by lfilak@… 18 years ago.
Example of imageObj->write
processtemplate.cgi (1.2 KB ) - added by lfilak@… 18 years ago.
Example of mapObj->processXTemplate
popup.map (1.4 KB ) - added by lfilak@… 18 years ago.
Mapfile for both examples.
legend.html (719 bytes ) - added by lfilak@… 18 years ago.
Template HTML for processLegend.
template.html (739 bytes ) - added by lfilak@… 18 years ago.
Template HTML for processTemplate.
query.html (26 bytes ) - added by lfilak@… 18 years ago.
A bad attempt to get processQuery to work.

Download all attachments as: .zip

Change History (17)

by lfilak@…, 19 years ago

Attachment: medina1.patch added

4.4.2 typemap patch

comment:1 by sgillies@…, 19 years ago

I don't think there will be a 4.4.3 release, but I don't mind applying the patch.
For 4.6, we're getting away from imageObj::write() and recommending that modules
implement imageObj::getBytes() instead. It's less confusing. Only file-like
objects should be writing. The Python and Java mapscripts have getBytes for the
version 4.6. You could look at those for examples.

comment:2 by lfilak@…, 19 years ago

I will inform the developer of the name change. The 4.4.2 patch is only intended
as a sample until the 4.6 patch is available.

comment:3 by lfilak@…, 19 years ago

I think this method may be best left as 'write' as it is a file-like object.

comment:4 by sgillies@…, 19 years ago

Status: newassigned
I think this is a difference in usage style between Java/Python and Perl. With 
Python it is more natural to do this

    print imageObj.getBytes()    # send image data to stdout

I looked again at the Perl ImageMagick API and that does indeed use something
more like

    imageObj->write(STDOUT);

It is fine with me if you want to implement only the write method for Perl. The
sooner you can patch against the 4.6 beta 3, the better because I am running out
of time to help with this before the conference.

by lfilak@…, 19 years ago

Attachment: 4.6.1_typemap.patch.gz added

Patch for 4.6.1 for image->write & map->processXtemplate

comment:5 by lfilak@…, 19 years ago

attachments.isobsolete: 01

comment:6 by sgillies@…, 18 years ago

Owner: changed from sgillies@… to sdlime
Status: assignednew
reassigning. i'm pretty sure i committed this one.

by lfilak@…, 18 years ago

Attachment: mapscript.patch added

Same as before just not gzip'd

comment:7 by lfilak@…, 18 years ago

attachments.isobsolete: 01

by lfilak@…, 18 years ago

Attachment: nonwrite.cgi added

Example of imageObj->write

by lfilak@…, 18 years ago

Attachment: processtemplate.cgi added

Example of mapObj->processXTemplate

by lfilak@…, 18 years ago

Attachment: popup.map added

Mapfile for both examples.

by lfilak@…, 18 years ago

Attachment: legend.html added

Template HTML for processLegend.

by lfilak@…, 18 years ago

Attachment: template.html added

Template HTML for processTemplate.

by lfilak@…, 18 years ago

Attachment: query.html added

A bad attempt to get processQuery to work.

comment:8 by lfilak@…, 18 years ago

(From update of attachment 546)
swig -perl5 -shadow -outdir . -o mapscript_wrap.c ../mapscript.i

Note: See TracTickets for help on using tickets.