[mapserver-users] ONE PASS QUERY (RFC 52) - FEATURE OR BUG?

BrainDrain paulborodaev at gmail.com
Sun Mar 21 18:31:46 EDT 2010


Please read carefully.
'old style' (two pass) query
advantages:
- in mapscript (c#) layer's query methods are CUMULATIVE (relative to other
layer's queries). Query result (success/failure) has no effect on other
layers when I call map.savequery.
- In this case (query file contains just oid's) - I CAN create COMPLEX
queries by applying different parameters and mixing query types
- Query result is oid (or row index in shapefile) - it's cool for creating
advanced attr. postqueries
and disadvantages (insignificant):
- query binary (closed) format? no output to string (only to file)
- query file sensitive to layer indexes (map file cleanups/refinements/some
normalization can cause query file incompatibility)
- if server data changed refreshing map image by old url to cgi with
queryfile parameter doesn't perform requery (need custom http
handler/module)
AND ONE PASS QUERY (RFC 52)
advantages:
- open query file format
- speedup (no random access)
disadvantages (huge):
- layer's query methods are NOT CUMULATIVE (relative to other layer's
queries). I CAN'T create COMPLEX queries (by using different
attribute/spatial queries (metadata driven) for different layers)!
- query result - some (shape)indexes and when I'm querying many layers in
sequence I NEED TO PRESERVE QUERY FILE FOR EVERY LAYER (on success result)
(!) and than on feature attributes (for some layer) demand (delayed request
- its a normal behavior, for. ex I'm requesting only shape names for some
layer which has results - to build results tree) I NEED to REQUERY this
layer by using preserver file! DAMN!
- there is no way to completely reproduce old mapscript behavior:
  1. I need to determine primary key ("id") field name (for ex. search for
"USING UNIQUE") - no need before!
  2. I need to retrieve all attributes (put to some cache) by
resultsGetShape to get right oid - it's not time saving operation - no need
before!
  3. I need to rerequest (!) feature attributes (or extract from custom
cache) by layer.getFeature BUT for shapefiles this function implementation
uses internal index (row position) - no id attribute (!) - and there is no
function to get it!
  4. NO WAY TO REPRODUCE COMPLEX QUERYING BY USING QUERYFILE CGI PARAMETER!
(Am I right?)
_________________________________________________________________________________________
To SPEED UP random access in old style querying I was able to use "IN (...)"
operator (I suppose that most time critical web apps uses postgis/ms sql
spatial/oracle spatial which supports it)
As for pt. 4:
at this time I decided to output every layer query results to postgis
service table (with session_id, map_id, layer_id, class_id, feature_id,
geometry of any type (should I preserve attributes in a BLOB?)) and to
handle data from this layer with 3 service map file layers
(point/line/polygon) which populates dynamically (copying class styles with
replaced colors for highlighting + using layer filter expression + using
class expressions). I can shrink service table once in a month to support
old session map files/url's.
But I've created web UI to update data from browser (drawing, attribute
editing) - so I need to update service table entries if corresponding object
was updated (if I wand to see actual selection objects)

I'm Disappointed....
-- 
View this message in context: http://n2.nabble.com/ONE-PASS-QUERY-RFC-52-FEATURE-OR-BUG-tp4775048p4775048.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list