[mapserver-users] NQuery problem

Fawcett, David David.Fawcett at state.mn.us
Fri Mar 13 12:35:58 EDT 2009


I was thinking of something like this for your data statement:

DATA "the_geom from (select w.majwsh_geom as the_geom, w.oid as oid,
w.name from watershed as w) using unique oid using srid=26915"

A more basic question for you:

Is your geometry column really named 'topology' and your table name
really 'tablename'?  

Before you try to query this layer or get it to be served in a WMS, can
you just get the geometry to draw on the map?  

David.

-----Original Message-----
From: Subha Ramakrishnan [mailto:subha at gslab.com] 
Sent: Friday, March 13, 2009 10:13 AM
To: Fawcett, David
Cc: Steve Lime; ruijgomes at gmail.com; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] NQuery problem


Hi David,

Thanks a lot for the reply.
It would be great if you can give me an example url.

Thanks & regards,
Subha

Fawcett, David wrote:
> Subha,
>
> In taking a quick look at your layer, I think that you have a problem 
> with your data statement.  I am quite sure that if you want to use an
> attribute(column) from your data layer for classification or query 
> results, you need to explicitly include the name of that column in the

> select query that is in your data statement.
>
> David.
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Subha 
> Ramakrishnan
> Sent: Friday, March 13, 2009 1:44 AM
> To: Steve Lime
> Cc: ruijgomes at gmail.com; mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] NQuery problem
>
>
> Hi
>
> Here's how the layer looks in my mapfile:
> layer
>   name abc
>   connectiontype postgis
>   connection "user= user dbname=xyz host=localhost"
>   type point
>   tolerance 20
>     group world
>     dump true
>     METADATA
>        "wfs_title" "Factbook Metadata"
>        "gml_include_items" "all"
>        "wms_feature_info_mime_type" "text/html"
>     END
>     template "template.html"
>     projection
>       "init=epsg:4326"
>     end
>     transparency 65
>     status on
>   data "topology from tablename using unique id using SRID = -1"
>   classitem "veg_class"
>         class
>                 name "AGRICULTURE"
>                 expression "AGRICULTURE"
>                 style
>                         symbol 'custom_icon'
>                         size 20
>                         color 179 189 209
>                         outlinecolor 000 000 000
>                 end
>         end
> end
>
> Status is on and template is defined.
> Am i missing something else?
>
> Thanks a lot for the help.
>
> Subha
> Steve Lime wrote:
>   
>> For a layer to be queryable you have to:
>>
>>   1 - either set Status DEFAULT, or explicitly turn it on (e.g.
>>     
> layer=abc)
>   
>>   2 - define the layer TEMPLATE property
>>
>> Are those true?
>>
>> Steve
>>
>>   
>>     
>>>>> Subha Ramakrishnan <subha at gslab.com> 03/13/09 12:38 AM >>>
>>>>>         
>>>>>           
>> Hi,
>>
>> I am also facing a similar problem. It doesn't throw an error but it 
>> doesn't give me a result either.
>>
>> My url looks like this :
>>
http://localhost/cgi-bin/mapserv?MAP=abc.map&MODE=nquery&LAYERS=abc&im
>>
gext=8920506.9477+3496535.4213+8954750.736418456+3530779.2100573704&im
>> gbox=657+209+686+239&imgxy=670+230
>>
>> The extent given here is within  the map extent.
>> Can you please tell me if there's some mistake here?
>>
>> Thanks a lot.
>>
>> Subha
>>
>> Steve Lime wrote:
>>   
>>     
>>> Nquery doesn't require qstring validation. What does your URL look
>>> like?
>>>
>>> Steve
>>>
>>>   
>>>     
>>>       
>>>>>> Rui Gomes <ruijgomes at gmail.com> 03/12/09 9:42 PM >>>
>>>>>>         
>>>>>>           
>>>>>>             
>>> I try to use the nquery function and i recived the follow error
>>> message:
>>>
>>> mapserv(): Web application error. Metadata 
>>> qstring_validation_pattern
>>>       
>
>   
>>> is not set.
>>>
>>> To avoid this i insert in the mapfile the follow lines inr the layer
>>> i want to query:
>>>
>>>
>>> METADATA
>>>           qstring_validation_pattern '.'
>>> END
>>>
>>>
>>> What this lines means. Why i have to put it?
>>>
>>> Thanks
>>>   
>>>     
>>>       
>>
>>   
>>     
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org 
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>   



More information about the mapserver-users mailing list