[Mapserver-users] Mouse Over

Steve Lime steve.lime at dnr.state.mn.us
Tue Mar 2 18:50:28 EST 2004


MapServer does not do much (if any) caching of features. It does cache
some information from a query to make processing a bit faster but it's
nothing more than an id value and class. For a querymap it works like
this:

  1) query is done, list of matching shapes is created (1st visit to
the data)
  2) template is parsed, each feature is retrieved and output as
necessary (2nd visit to the data)
  3) if necessary, query map is produced (3rd visit to the data)

Your original assumption is correct and yes, this can be quite
expensive depending on the dataset. This is a known issue and there is
already a bug filed  concerning it- we need to cache features in step 1.
With small result sets it's easy, we can just use the feature lists that
already exist in MapServer. It get's complicated with large result sets
though, especially when multiple instances of the software are running.
Memory usage could go through the roof.

On the bright side it works fine now with minimal performance issues
for most folks and can only get better.

Steve

>>> "Charlton Purvis" <cpurvis at asg.sc.edu> 3/2/2004 7:20:42 AM >>>
Well, maybe I can answer part of my question.  At least w/ mapscript,
everything's bundled into a mapObj, right?  So we've already hit the
database or whatever and run our queries to produce this object.
 
So if we want a picture, we have to draw something based on this
mapObj.  If we want a querymap, we have to draw that based on the
mapObj.
 
Am I correct in thinking that it is the mapObj that is traversed
multiple times to produce multiple outputs?  I guess there's no way of
getting around that, but it is certainly a heck of a lot better than my
original assumption which was that the data sources were being pinged
each time.

	-----Original Message----- 
	From: Charlton Purvis 
	Sent: Tue 3/2/2004 8:02 AM 
	To: Steve Lime; pucher at atlas.gis.univie.ac.at;
Michael.Smith at erdc.usace.army.mil; mapserver-users at lists.gis.umn.edu;
bartvde at xs4all.nl 
	Cc: 
	Subject: RE: [Mapserver-users] Mouse Over
	
	

	OK.  Thanks, Steve.
	
	I've got a litlle of both working in my favor:  dashing a bit of
CGI + a wallop of PHP for the final image + imagemap product.  It's
working well.
	
	But I've got another question that might start to bug me if it
turns out to be true.  Let's take your example of Minn. and the county
names.  (Consider using SC data and counties -- we've got great
backwards county names.)  How many passes is that making through the
data?  2?  1 for the image + 1 for the imagemap?  Does any kind of
caching go on behind the scenes for that 2nd request if there is one?
	
	I'm not too worried about it right now since I know that the
database is caching my 1st request (if there is a 2nd).  But I'm about
to unload a bucket load of raster data into the mix of shapefiles in the
db, and I know that the system ain't caching squat for those (perhaps
some OS-level file caching but that's it) -- tiling, yes, but caching,
no?
	
	If it is making 2 requests, is there a way I the code could be
made more parallel?  I.e. one pass produces two or an arbitrary # of
outputs.  I have negative interest in coding it myself at this point --
I'm more curious than anything.  But I think there would be great value
in that.  At least I know from my own experience on a given screen, the
same source data is being shown in about 3 different ways at a given
time.  So why traverse it more than once?
	
	Thanks,
	
	Charlton
	
	        -----Original Message-----
	        From: Steve Lime [mailto:steve.lime at dnr.state.mn.us] 
	        Sent: Mon 3/1/2004 6:47 PM
	        To: Charlton Purvis; pucher at atlas.gis.univie.ac.at;
Michael.Smith at erdc.usace.army.mil; mapserver-users at lists.gis.umn.edu;
bartvde at xs4all.nl 
	        Cc:
	        Subject: RE: [Mapserver-users] Mouse Over
	       
	       
	
	        The searchmap stuff is inherently CGI. Since with
MapScript you're
	        essentially writing your own custom CGI you'd have to
code it yourself.
	        It's not hard, you just compute the extent of next image
BEFORE doing
	        the query. I thought templates can be accessed via
MapScript but I may
	        be wrong. If not, then they should be.
	
	
	_______________________________________________
	Mapserver-users mailing list
	Mapserver-users at lists.gis.umn.edu 
	http://lists.gis.umn.edu/mailman/listinfo/mapserver-users 
	




More information about the mapserver-users mailing list