problem in Dynamic query with postGIS
nimalika Fernando
nimalikaf at YAHOO.COM
Tue Mar 6 01:44:59 PST 2007
Hi,
Thank you very much for the guidence
Actually I tried with QUERYMAP and can get the work done if use data from
shape files , through a filter.
But I am not clear about how to do the same using data in postGIS. My
requirement is to use data in the database.
can you please help me on using QUERYMAP and postGIS query together ?
Any help is highly appriciated.
best regards
nimalika
On Fri, 2 Mar 2007 15:16:52 +0100, J. Parapar <listario at GMAIL.COM> wrote:
> Nimalika:
>
> It seems that in the qstring parameter you are specifying only the
>name of the village and not a condition like
>qstring=dsd_n='Ambalanthota. This results in an incorrect SQL
>condition. Changing this affects the use you do of qstring as a
>variable in DATA. I think you should try again with QueryMap, it is a
>simpler way to get the results of the query highlighted in the map.
>
> Best regards,
> Jorge
>
>
>2007/3/1, nimalika Fernando <nimalikaf at yahoo.com>:
>> hi everybody,
>>
>> I am working in a disaster recovery application , using Mapserver and
postGIS
>> for mapping part.
>>
>> I need to implement a simple search facilty, for eaxmple if user already
knows
>> a village affected , by selecting that village name using a combo box in web
>> interface the related village should be highlighted in the map.
>>
>> I am not clear about how to implement such but I tried several options.
>> I have used a QUERYMAP object and tried . But I am not getting the work
>> done. My data resides in postGIS db and working with Maapserver in CGI
mode
>> is fine for basic operations.
>> My query in the map file is as follows
>>
>> DATA "the_geom from (select alldsdivisions.the_geom as
>> the_geom,alldsdivisions.gid as oid ,
>> alldsdivisions.dsd_n as dsd_n from alldsdivisions
>> where alldsdivisions.dsd_n ='%qstring%')
>>
>> error mesage I get is as follows
>>
>> prepare_database(): Query error. Error executing POSTGIS DECLARE (the
>> actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
>> dsd_n::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),oid::text
>> from (select alldsdivisions.the_geom as the_geom,alldsdivisions.gid as oid ,
>> alldsdivisions.dsd_n as dsd_n from alldsdivisions where alldsdivisions.dsd_n
>> ='Ambalanthota') AS selectedgs WHERE (Ambalanthota) and (the_geom &&
>> setSRID( 'BOX3D(181659.373889 74242.41425975,303213.047119
>> 165407.66918225)'::BOX3D,-1) )'
>>
>> Postgresql reports the error as 'ERROR: column "ambalanthota" does not
>> exist '
>>
>> here , "Ambalanthota" mean a value of coumn dsd_n of table
>> alldsdivisions. qstring is replaced by the user selected value of the combo
box.
>>
>> I have tried to get help from postGIS users but still i couldn't solve this
>>
>> can anybody help me to figure out a solution , pls?
>>
>> thank you in advance,
>>
>> Nimalika
>> from Sri Lanka
>>
More information about the MapServer-users
mailing list