Web application error

Pericles S. Nacionales naci0002 at UMN.EDU
Fri Mar 31 14:04:47 EST 2006


Sorry wasn't paying attention. :)

I don't see a problem on quick look but try simplifying your layer (as a 
test) and see if it works:
   LAYER # query layer using the dedloc PostgreSQL view
     CONNECTIONTYPE postgis
     NAME          saint_dedications
     CONNECTION    "user=erdb13 dbname=stdraft"
     DATA          "geom from dedloc using unique dr using SRID=27700"
     STATUS        DEFAULT
     DEBUG         ON
     TYPE          POINT
     TOLERANCE     25
     CLASS
       NAME        "Dedications"
       TEMPLATE    "result.html"
       DEBUG       ON
       STYLE
         SYMBOL      "circle"
         SIZE        5
         COLOR       255 0 0
         OUTLINECOLOR 0 0 0
       END
     END
   END # test query layer

Note the lower case on the DATA parameter...  I don't know if that's 
still a problem.  If that still doesn't work, check the PostGIS log (if 
you have logging enabled)...  Also, I don't know which version of 
MapServer you're using.  Try upgrading to 4.8.3 (or downgrading to 
4.6.x).  You can also do a search on bugzilla to see if there's any open 
bugs that pertain to your problem.

Good luck!
-Perry


Dave Stone wrote:
> The layer addressing the PostGIS view was in the original post, but in 
> case the problem is elsewhere in the .map file, I've attached the whole 
> thing. Also the uig.html template which displays the map. The query 
> template (result.html) you have below. Thanks for your patience; I 
> really appreciate your support.
> 
> Cheers,
> 
> Dave
> 
> Pericles S. Nacionales wrote:
>> Dave,
>>
>> Can you please post your mapfile or at least the object corresponding 
>> to the layer you're querying?  We can't answer your question without 
>> the details.
>>
>> -Perry
>>
>> Dave Stone wrote:
>>> Apologies for emailing direct -- LISTSERV keeps rejecting my posts as 
>>> duplicates.
>>>
>>> No joy so far, I'm afraid, Perry. You were right about the PostGIS 
>>> names being upper-case, so I've
>>> changed them all to lower-case, and the result.html query template 
>>> now looks like this:
>>>
>>> # query template
>>> <html>
>>> <head>
>>>  <title>MapServer - ItemQuery</title>
>>> </head>
>>>
>>> <body bgcolor="#ffffff">
>>>
>>> <font size="+2" face="arial,helvetica"><b>Case 1: Simple ItemQuery 
>>> With QueryMap</b></font>
>>>
>>> <p>
>>>
>>> This is just a simple dump of a few attributes for an individual 
>>> location
>>> in the test suites parishes layer:
>>>
>>> <p>
>>>
>>> <b>Place Name:</b> [placename]<br>
>>> <b>Qualifying Name:</b> [qualifyingname]<br>
>>> <b>Location Type:</b> [locationtype]<br>
>>> <b>Grid Reference:</b> [locationgridref]<br>
>>> <b>Religious Order:</b> [religiousorder]<br>
>>>
>>> <p>
>>>
>>> and here's the map of the query results (you can zoom to a set of 
>>> results as well):
>>>
>>> <p>
>>> </body>
>>> </html>
>>>
>>> I had TOLERANCE set to 5 (pixels) for the PostGIS layer originally, 
>>> and tried upping it to 25 in
>>> hope that it would make it easier to 'hit the spot' when clicking on 
>>> the dots on the map. But no
>>> output -- just a blank page titled 'MapServer Message'.
>>>
>>> I also tried setting DEBUG ON for the layer and class objects, but 
>>> there wasn't anything significant
>>> in the log file, just some map extent parameters.
>>>
>>> Thanks for the pointer to the 'flashy' mapfile reference; there's 
>>> some useful examples in there.
>>>
>>> Cheers,
>>>
>>> Dave
>>>
>>> ----- Original Message ----- From: "Pericles S. Nacionales" 
>>> <naci0002 at umn.edu>
>>> To: "Dave Stone" <D.Stone at ed.ac.uk>
>>> Cc: <MAPSERVER-USERS at lists.umn.edu>
>>> Sent: Monday, March 27, 2006 6:25 PM
>>> Subject: Re: [UMN_MAPSERVER-USERS] Web application error
>>>
>>>
>>>> Dave,
>>>>
>>>> What does your result.html query template look like?  Did you 
>>>> capitalize all
>>>> the attribute names (as in "[ATT_NAME]")?  If so, make them small 
>>>> caps for
>>>> PostGIS tables--[att_name].
>>>>
>>>> Also, here's another hint: Use the TOLERANCE keyword...
>>>> http://mapserver.gis.umn.edu/docs/reference/mapfile/layer
>>>>
>>>> Or if you prefer a fancier mapfile reference, check
>>>> http://umn.mapserver.ch/index_en.php
>>>>
>>>> Good luck!
>>>> -Perry
>>>>
>>>> On Monday 27 March 2006 08:07, Dave Stone wrote:
>>>>> I am having problems adapting the class-level query template 
>>>>> technique in
>>>>> Example 3.1 of the MapServer Tutorial.
>>>>>
>>>>> Essentially, I want to do as the tutorial example does, i.e. be 
>>>>> able to
>>>>> click on a point feature on the map, and have a query template open 
>>>>> up and
>>>>> display attributes for the point.
>>>>>
>>>>> The only significant difference between my setup and the example's 
>>>>> (that I
>>>>> can see) is that the example queries a layer (cities) whose data 
>>>>> source is
>>>>> a shapefile containing polygons, whereas my source is points in a 
>>>>> PostGIS
>>>>> view (dedloc). The .map file segment for the layer is:
>>>>>
>>>>>  LAYER # query layer using the dedloc PostgreSQL view
>>>>>     CONNECTIONTYPE postgis
>>>>>     NAME          saint_dedications
>>>>>     CONNECTION    "user=erdb13 dbname=stdraft"
>>>>>     DATA          "geom from dedloc USING UNIQUE dr USING SRID=27700"
>>>>>     STATUS        DEFAULT
>>>>>     DEBUG         ON
>>>>>     TYPE          POINT
>>>>>     FILTERITEM    dedicationtype
>>>>>     FILTER        "dedicationtype='%dtype%'"
>>>>>     TOLERANCE     5
>>>>>     CLASS
>>>>>       NAME        "Dedications"
>>>>>       MINSCALE    2000000
>>>>>       TEMPLATE    "result.html"
>>>>>       STYLE
>>>>>         SYMBOL      "circle"
>>>>>         SIZE        5
>>>>>         COLOR       255 0 0
>>>>>         OUTLINECOLOR 0 0 0
>>>>>       END
>>>>>     END
>>>>>     CLASS
>>>>>       MAXSCALE    1900000
>>>>>       TEMPLATE    "result.html"
>>>>>       STYLE
>>>>>         SYMBOL      "circle"
>>>>>         SIZE        10
>>>>>         COLOR       255 0 0
>>>>>         OUTLINECOLOR 0 0 0
>>>>>       END
>>>>>     END
>>>>>   END # test query layer
>>>>>
>>>>>
>>>>> and the URL invoking the query template is:
>>>>>
>>>>> http://drayton.ucs.ed.ac.uk/cgi-bin/mapserv?imgxy=300.0+300.0&
>>>>> imgext=217114.636666+624099.796666+387452.636666+794437.796666&
>>>>> map=%2Fvar%2Fwww%2Fhtml%2Fsaints%2Fdata%2Fparish%2Fuig.map&
>>>>> savequery=true&mode=browse&img.x=320&img.y=271&zoomdir=0&zoomsize=4&
>>>>> layer=parish_labels&layer=parish&layer=saint_dedications&mode=query&
>>>>> dtype=Altar+dedication
>>>>>
>>>>> What I get when I click on a dot on the map displaying 
>>>>> saint_dedications is
>>>>> a web page headed 'MapServer Message', but then no message, no 
>>>>> attributes
>>>>> for the dot I clicked, nothing!
>>>>>
>>>>> Can anyone suggest what might be going wrong? The query template
>>>>> (result.html) is very simple; like Example 3.1, it just displays
>>>>> boilerplate HTML and attribute values for the dot that was clicked.
>>>>
>>>> -- 
>>>> Pericles S. Nacionales
>>>> Conservation Biology Program
>>>> University of Minnesota
>>>> e-mail: naci0002 at umn.edu
>>>>
>>>
>>>
>>> .
>>>
>>



More information about the mapserver-users mailing list