Opened 18 years ago

Last modified 18 years ago

#1579 assigned defect

expression not evaluated for query

Reported by: silke.reimer@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer CGI Version: unspecified
Severity: normal Keywords:
Cc: silke.reimer@…

Description

Hallo!

It seems to me that the expression for classification of a layer is not
evaluated  for queryByRect or queryByPoint. See the following (constructed) case:
I have one shapefile with the values "A" and "B" for the attribute "type" and an
layer that shows only those of type=A (defined with CLASSITEM = type and an
EXPRESSION in the corresponding CLASS).

Querying the second layer leeds to results even containing shapes with type=B.
This holds true for PHP/mapscript but also for a query by a WMS
GetFeatureInfo-Request.

I scanned the source code of mapserver 4.6 (the version I am working with) as
well as of version 4.8-beta2. In both cases I couldn't find any place where the
evaluation of the expression is done during a query. I also had a look an the
bug-tracker an the mailinglist archives but couldn't find any hint.

Have I overseen something?

         Silke

P.S.: If necessary I can construct a test case which fails with the current
version. 

P.P.S.: 

For the case that I have overseen something, here my full example of layer
definition:
  # Landesmessnetz Menge
  LAYER
    DATA "/usr/local/httpd/gwmessnetz/data/messstellen/messstellen"
    NAME netz_menge
    METADATA
        "DESCRIPTION" "Landesmessnetz Menge"
        "RESULT_FIELDS" "invname, mkz, longname, brgort, tk25, arnum, bo_ident,
projekt, auftrag, kommentar, bohrfirma, brgzweck, bohrz_von, bohrz_bis,
bohrverf, xcoord, ycoord, xcoordo, ycoordo, zcoorde, zcoordb, invmbeg, invzbeg,
invzend, strat, mesartmvp, foto, bewertung, bohrprofil"
        "RESULT_HEADERS" "Messstellenname, Messstellenkennzahl, Bohrungsname,
Bohrungsort, TK25, Archiv-Nummer, Bohrarchiv-Ident, Projekt, Auftraggeber,
Kommentar, Bohrfirma, Bohrungszweck, Bohrzeit von, Bohrzeit bis, Bohrverfahren,
Rechtswert, Hochwert, Original-Rechtswert, Original-Hochwert, Endteufe, Höhe zu
NN (GOK), Messpunkthöhe zu NN (ROK), Filtertiefe von, Filtertiefe bis,
Stratigrafie, Messstellenart, Foto, Bewertung, Bohrprofil"
    END
    SIZEUNITS PIXELS
    STATUS OFF
    TOLERANCE 10
    TOLERANCEUNITS PIXELS
    TEMPLATE void
    TYPE POINT
    UNITS METERS
    MINSCALE 1000
    MAXSCALE 1500001
    SYMBOLSCALE 100000
    CLASSITEM mesartmvp
    CLASS
      NAME "Messstellen"
      EXPRESSION /,M/
      STYLE
        COLOR 0 0 255 # blau
        MAXSIZE 20
        MINSIZE 6
        OUTLINECOLOR 0 0 0 # schwarz
        SIZE 12
        SYMBOL "circle"
      END
    END
  END # Landesmessnetz Menge

Change History (2)

comment:1 by sdlime, 18 years ago

Status: newassigned
I think what you are saying is shapes not matching a class expression are 
finding their way into the result set.

There is code in both functions that gets a shape's class and bails on the 
shape if a number of conditions are met. It is possible that those conditions 
are not quite right. There probably needs to be an additional test that takes 
the number of classes into account. I don't want to fix at this late date for 
4.8 though (I need to think more about the implications), perhaps for 4.8.1.

There is a work around for you though, simply put your "TEMPLATE void" into the 
class definition rather than at the layer level.

Steve

comment:2 by silke.reimer@…, 18 years ago

Cc: silke.reimer@… added
Thanks for answer. Your suggestions (putting TEMPLATE void into the class
definition) indeed helps.

If you need help in constructing a test case please contact me.
Note: See TracTickets for help on using tickets.