[Mapserver-users] Re: Implementing querying functionality using Perl MapScript

pkishor_98 pkishor at geoanalytics.com
Mon Jul 14 14:42:37 PDT 2003


--- In mapserver-users at yahoogroups.com, AMC Story <s9646183 at s...> wrote:
> Hi there everyone,
> 
> I've been using Perl MapScript to develop the interface 
> of my application, and  am now wanting to implement the 
> querying functionality that I had going with 
> the old mapserver CGI version, but now with MapScript.  

could you elaborate more on --

- what have you already developed with Perl/Mapscript; and
- what you mean by "querying functionality"

Until you do that, I am going to assume you mean identifying a feature
based on the user's mouse-click.

> I was wondering if there are any examples of the code
> needed to do this, as I can't seem to find 
> anything more than very brief (and apparently incorrect!) 
> snippets in the 
> archives.  

which archives did you look at? There are several very nice examples
on the wiki, and in the Perl/Mapscript docs. The best, most complete
example is the mapquakes.pl script. It shows you the building blocks.

Briefly... you capture the mouse clicks and use them to create the new
map envelope and generate a new image. If you are querying... you once
again use the mouse clicks to get the shapeindex and then get its
associated attribute data from either the <shape>.dbf or a related
external database table. Keep in mind, the mouse clicks would be
imagespace, and will have to be converted to geographic space before
doing anything with them.

There are definitely fewer ready-to-use, code capsules for
Perl/Mapscript, and some of us have talked about remedying the
situation. Most Perl/Mapscript users, however, have found the existing
examples quite helpful in guiding them and setting them on the correct
path to developing their own code. Each application is different, and
it is hard to provide a demo that will work for everyone.

Please look at the above mentioned examples on the wiki, and then if
you have specific questions come and ask us. One of us will be able to
help you.






More information about the MapServer-users mailing list