QUERYMAP and postgis

Peter Huis in 't Veld peterh at IVS90.NL
Wed Jan 18 13:49:52 PST 2006


Bart,

Your right about the oid column, this is part of my dataset. I replaced 
the geom column by the oid.  The result is still the same.

Postgis   1.0.4
Postgres 8.03
MapServer 4.6

The problem I encounter are related to selecting the right coordinates 
on the map. I have debugged the queries and I did  forget to provide the 
tablename with a schema prefix (public). So, I only have to resolve the 
problem of pin pointing the right poi. Any suggestions? Can I switch on 
the display of the coordinates in my browser?

Peter



Bart van den Eijnden (OSGIS) wrote:

> Peter,
>
> I would never suggest using the geometry column as the unique column. 
> The default used is oid, but as you might know as of PostgreSQL 8.1 
> this is not created anymore automatically. Older PostgreSQL versions 
> do have it standard, so just leave out your USING UNIQUE in that case 
> from the DATA statement. Is there not a primary key on your table 
> which you can use otherwise instead of the geometry column?
>
> I would suggest getting some debug information out of Mapserver using 
> the practices described here:
>
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?DebuggingMapserver
>
> or just log the queries which Mapserver sends at the PostgreSQL level 
> (PostgreSQL logging).
>
> In order to solve this, tt might help also providing some version info 
> (which Mapserver version, which PostgreSQL version, which PostGIS 
> version etc.).
>
> Best regards,
> Bart
>
> Peter Huis in 't Veld wrote:
>
>> Hello
>>
>> I've the question: How can I show the attributes of a a postgis query 
>> using mapserver. At the moment I've GIS layer showing me all the 
>> object in the spatial database, so the query isn't isn't the problem. 
>> Changing the mode into query mode Ik get the following message:
>>
>> msQueryByPoint(): Search returned no results. No matching record(s) 
>> found.
>>
>> I've seen the remark on the mapserver web-site by Bart vd Eijnden, 
>> but this doesn't give me any additional info. I made the following 
>> changes
>> to the code in order to query the Map file by clicking on the map item:
>>
>> *QUERYMAP
>>   STATUS ON
>>   STYLE HILITE
>>   COLOR 0 255 0
>> END
>> *
>>
>> LAYER
>>    CONNECTIONTYPE POSTGIS
>>    CONNECTION  ....
>>    DATA "object_geom  from  (SELECT a, b, c, object_geom  from table) 
>> as myquery using unique object_geom"
>>    *TOLERANCE 5*
>>    CLASS
>>        LABEL
>>           ...
>>        END             END
>>  *  TEMPLATE "query_result.html"*
>>    PROJECTION
>>             ......
>>    END
>> END
>>
>> The query_result.html looks like:
>>
>>  <table>
>>     <tr>
>>       <td>[lrn]</td>
>>       <td>[a]</td>
>>       <td>[b]</td>
>>       <td>[c]</td>
>>     </tr>
>>  </table>
>>
>> Should the query_result.html be in a specific directory? I've places 
>> it in htdocs where my index.html is present.
>>
>> Thanks for any help!
>>
>> Peter
>>
>>
>
>



More information about the MapServer-users mailing list