extending queries with (php_) mapscript

Yewondwossen Assefa assefa at DMSOLUTIONS.CA
Wed Apr 4 16:27:59 EDT 2007


Daniel Morissette wrote:
> At first sight, this is a small change that can be added to 5.0 without 
> a RFC, but would need a tracking bug at a minimum.
> 
> A few notes/comments:
> 
> - The scenario that you outlined here would also require a 
> clearResultCache() method, or am I missing something?
> 
> - Currently in PHP MapScript (not sure about other MapScript), the 
> resultCacheObj is not exposed directly. Instead, we just expose a 
> layerObj.getResult(). Should the addResult() and clearResultCache() be 
> added to the layerObj as well or should we consider exposing the 
> resultCacheObj in version 5.0? ... um... if we expose the resultCacheObj 
> then we may need a RFC.
> 
According to docs, swig Mapscript does expose resultCacheObj through a 
layer.getResults call. Individual resultcacheobj members are accessed 
through a getresult method on this object.
If we do some work toward this, I think we should consider syncing php 
to follow the swig Mapscript. We would leave the  layer.getResult for 
backward compatibility as it is the case in the swig version.
In this case, I think It makes more sense to have these functions on the 
resultcache object.

> - Can someone comment on the impact of this on SWIG MapScript?
> 
> Daniel
> 
> Paul Spencer wrote:
>> Hi devs,
>>
>> I would like to be able to do some slightly fancier stuff with queries 
>> than is currently possible using mapscript.  Specifically, I'd like to 
>> be able to extend an existing selection and optionally toggle shapes 
>> in the result set.
>>
>> I was hoping that simply loading a previously saved query and then 
>> querying would do the 'extend' part but it seems queries flush 
>> existing results.
>>
>> I think what would solve my problem would be to call addResult from 
>> (php_) mapscript.  Then I could:
>>
>> * load the saved query
>> * get the indexes of the existing results
>> * flush all results
>> * run the new queries
>> * get the indexes of the new results and merge them with the existing 
>> results
>> * flush the results
>> * run through the lot and add the results back
>> * save the query
>>
>> I believe that mapquery.c has the appropriate addResult function so 
>> this would be a matter of exposing it in (php_) mapscript and adding 
>> the appropriate documentation.
>>
>> Would this require an RFC?  Could we get it in for 5.0?  Should I be 
>> considering another approach?
>>
>> Cheers
>>
>> Paul
>>
>> +-----------------------------------------------------------------+
>> |Paul Spencer                          pspencer at dmsolutions.ca    |
>> +-----------------------------------------------------------------+
>> |Chief Technology Officer                                         |
>> |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
>> +-----------------------------------------------------------------+
> 
> 


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the mapserver-dev mailing list