Ticket #1371 (new enhancement)

Opened 8 years ago

Last modified 7 years ago

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

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

Change History

Changed 8 years ago by lfilak@…

4.4.2 typemap patch

Changed 8 years ago by sgillies@…

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.

Changed 8 years ago by lfilak@…

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.

Changed 8 years ago by lfilak@…

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

Changed 8 years ago by sgillies@…

  • status changed from new to assigned
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.

Changed 8 years ago by lfilak@…

Changed 8 years ago by lfilak@…

  • attachments.isobsolete changed from 0 to 1

Changed 8 years ago by lfilak@…

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

Changed 7 years ago by sgillies@…

  • owner changed from sgillies@… to sdlime
  • status changed from assigned to new
reassigning. i'm pretty sure i committed this one.

Changed 7 years ago by lfilak@…

Changed 7 years ago by lfilak@…

  • attachments.isobsolete changed from 0 to 1

Changed 7 years ago by lfilak@…

Same as before just not gzip'd

Changed 7 years ago by lfilak@…

Example of imageObj->write

Changed 7 years ago by lfilak@…

Example of mapObj->processXTemplate

Changed 7 years ago by lfilak@…

Mapfile for both examples.

Changed 7 years ago by lfilak@…

Template HTML for processLegend.

Changed 7 years ago by lfilak@…

Template HTML for processTemplate.

Changed 7 years ago by lfilak@…

A bad attempt to get processQuery to work.

Changed 7 years ago by lfilak@…

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

Note: See TracTickets for help on using tickets.