[mapserver-users] 3.5 mapscript problem

Stephen Lime steve.lime at dnr.state.mn.us
Mon Sep 24 12:31:03 EDT 2001


The previous email you mention refers to version prior to 3.5. 3.5 requires
that a layer have STATUS ON or DEFAULT and that it has at least 1 
class with a TEMPLATE defined or a global layer TEMPLATE (applies
to all classes).

STATUS QUERYONLY is gone because by tying up STATUS with whether
or not a layer is for query only is stupid (on my part) cause you can't explicitly
turn layers on or off. Therefore a new layer TYPE was created called QUERY.
It actually doesn't affect the query functions which don't use layer TYPE but
drawing functions know to ignore these layers.

QUERY objects are gone and their contents rolled into CLASS objects. This
was do to minimize the number of EXPRESSIONs that needed to be processed.
By combining CLASS and QUERY the same layer-based functions could be
used for drawing and querying. That really simplified the layer API.

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> <imap at chesapeake.net> 09/22/01 02:16AM >>>

Steve,

With regard to mapscript querys in 3.5
In one of your emails earlier in the year, you said that you need:

No. A layer is queryable if it is:

  - ON, either explicitly via a form or has STATUS DEFAULT or QUERYONLY

and

  - has a QUERY object with a TEMPLATE defined.


Seems like in my first mapfile definition:

> LAYER
>   NAME ctyindex
>   TYPE QUERY
>   STATUS ON
>   DATA "ctyindex"
>   TEMPLATE dummy
> END

is missing the
    QUERY
       TEMPLATE dummy
    END

and 3.5 errors out when this is included in the layer.
When it is removed, the query does not work and yeilds
"No matching record(s) found."   Likewise, in 3.3, removing
those same lines produces the same error, so I suspect
the layer has no QUERY object.  Anyway I got my 3.3 and
3.5 mapscript co-existing, and the 3.3 query scripts seems 
to be working OK.

I also tried changing the mapfile as you suggest with
TYPE LINE, but that didn't have any effect.

If I set STATUS QUERYONLY in the mapfile, 3.5 gives me
getSymbol(): Symbol definition error. (QUERYONLY):(11)

Looking at the docs, specifically the 3.5 Mapfile reference, 
the Query Object section is gone.   I am just trying to 
figure out what is going on with QUERY.

Regards,

Chris Stuber (mapsurfer)
Silicon Mapping Solutions, Inc
(410)257-3187


Stephen Lime wrote:
> 
> Your first layer def is fine, I may have screwed up and am not recognizing
> "TYPE QUERY" properly. In your case the TYPE is irrelevant since queries
> operate on the real type of the data rather than the display type. Try setting
> TYPE to LINE and see if that works.
> 
> Steve
> 
> Stephen Lime
> Internet Applications Analyst
> 
> Minnesota DNR
> 500 Lafayette Road
> St. Paul, MN 55155
> 651-297-2937
> 
> >>> <imap at chesapeake.net> 09/21/01 01:54AM >>>
> 
> with LAYER, needs a QUERY object/directive and a TEMPLATE
> for the query to succeed, otherwise nothing is found.
> It current looks like this:
> 
> LAYER
>   NAME ctyindex
>   TYPE QUERY
>   STATUS ON
>   DATA "ctyindex"
>   TEMPLATE dummy
> END
> 
> gives me nothing back:
> 
> Fri Sep 21 02:32:36 2001 - msQueryByRect(): Search returned no results. No
> matching record(s) found.
> 
> If I embed a QUERY object in the layer:
> 
> LAYER
>   NAME ctyindex
>   TYPE QUERY
>   STATUS ON
>   DATA "ctyindex"
>   QUERY
>      TEMPLATE dummy
>   END
> END
> 
> 3.5 complains with
> 
> Fri Sep 21 02:48:29 2001 - loadLayer(): Unknown identifier. (QUERY):(13)
> 
> There may be a fix in the mapfile that I am not aware of... , If it smells
> like a bug let me know and I will post to bugzilla.
> 
> Regards,
> 
> Chris




More information about the mapserver-users mailing list