MapScript: drawing points with Perl

Lowell.Filak lfilak at MEDINACO.ORG
Mon Apr 23 09:58:46 PDT 2007


Benoit Myard writes: 

> Hi list, 
> 
> I'm trying to set up an application whose goal is to add Point data to
> an existing map using Perl MapScript. My plan is to put all that's
> static in a mapfile and to draw the points afterwards. 
> 
> For now, I haven't managed to draw anything except what's in the
> mapfile and I would like to know if there is anything special I should
> know. For example, when you create a point, which projection is in use
> ? 
> 
> I attached a sample script which should draw a big point over Paris
> but actually doesn't. 
> 
> 
> Also, I noted that I can't "use strict;" since the MapScript Variables
> (MS_ON, MS_SINGLE, ...) produce errors even when you prefix them with
> 'mapserver::' : 
> 
> Argument "MS_ON" isn't numeric in subroutine entry at
> /opt/csw/lib/perl/site_perl/mapscript.pm line 35. 
> 
> 
> Allthough there is not much documentation for the Perl-side of
> MapScript, the MapScript API Reference should be sufficient. Just in
> case someone is aware of some well-rounded documentation or examples
> for Perl MapScript, it would be great to share with others :).

Benoit,
Please pardon my ignorance on projections but the coordinates of the point 
look something like northing/easting.?
Unless you assign a projection to the layer I believe the projection & units 
of the mapObj are assumed or it is assumed that all layers are the same and 
no reprojection is needed.
For example, all the layers we use are projected into northing/easting using 
the same datum & feet so we don't specify any projection information. 

An old presentation particular to Perl is at the following but is not 
updated:
http://www.highwayengineer.co.medina.oh.us/mapserver/mapscript/title.html
There are also entries in the old wiki that may help:
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PerlMapScript 

Lowell Filak



More information about the MapServer-users mailing list