Improvement to query error message, FAQ

Philip Mark Donaghy philip.donaghy at GMAIL.COM
Tue Nov 29 05:46:38 EST 2005


I've just started reusing MapServer. It's been a while. I just wanted
to make a comment about this error message. "msQueryByPoint(): Search
returned no results. No matching record(s) found". I am using the
workshop.zip and MapServer 4.6.1.

I created some new layers for a project that I have. And I couldn't
figure out why the default query function did not work.

I simply didn't know that a TEMPLATE object was required in the CLASS
object. This is vaguely aswered by a FAQ. My contribution would be to
add another FAQ.

Q. Why do I get the message "msQueryByPoint(): Search returned no
results. No matching record(s) found" when I query a feature known to
exists?

A. The query feature requires a TEMPLATE object in the CLASS object of
your LAYER definition. The value points to a html fragment using
MapServer template syntax.

Example MapFile fragment:

  LAYER
    NAME Parcel9
    TYPE POLYGON
    STATUS OFF
    DATA Parcels/area09_parcels
    CLASS
      STYLE
        OUTLINECOLOR 128 128 128
        COLOR 153 205 255
      END
      TEMPLATE "templates/Parcels/area09_parcels.html"
    END

    HEADER "templates/Parcels/area09_parcels_header.html"
    FOOTER "templates/Parcels/area09_parcels_footer.html"

  END

Example Template:

<tr>
  <td>[lrn]</td>
  <td>[PIN]</td>
</tr>

The [lrn] is a special keyword that indicates the resulting line
number which starts at 1. [PIN] is the name of a feature attribute.

Thanks,
Philip Donaghy
--
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62



More information about the mapserver-dev mailing list