Question on queryByAttributes - multiple fields

Cord Thomas cord at LUPINEX.COM
Mon Nov 29 18:55:03 EST 2004


Hello all

Using MapServer 4.4x and Perl Mapscript on Linux against a PostGIS
database, i am having difficulty with the queryByAttributes method on a
polygon layer.

I include my MAP snippet below, but basically, my code is this:

  my $res = $mapLayer->queryByAttributes($map, $qryFlds,
                                         $qryVals, $mapscript::MS_MULTIPLE);

where $qryFlds = "stateid,name"
and   $qryVals = "(stateid='ME' and name='Knox')"

Is this the valid way to specify multiple fields - how can i get mapserver
to dump the full query string to the log file?  i have a log file setup,
and if i screw up the query string, it throws an error, but these criteria
are right and mapserver reports this:

- msQueryByAttributes(): Search returned no results. No matching record(s)
found.

thanks in advance

.MAP snippet:

    LAYER
      NAME "counties"
      STATUS OFF
      TYPE POLYGON
      DATA "wkb_geometry from county"
      CONNECTION "user=tiger password=[somepassword] dbname=tiger
host=localhost port=543
2"
      CONNECTIONTYPE POSTGIS
      PROJECTION
         "proj=latlong"
         "datum=NAD83"
      END
      UNITS DD

      CLASS
        COLOR 74 135 33
        OUTLINECOLOR 28 55 11
        TEMPLATE /var/www/cellsign/map/states_sm.html
      END
    END



MAP snippet



More information about the mapserver-users mailing list