you're mixing Postgis and standard layer ("ms") definitions. Check the 
required syntax for Postgis layers in the manual. Unfortunately 
MapServer requires different query syntax for different type of layers.

armin


On 20/09/2011 21:29, Ricardo Cuítiva wrote:
> Hello,
>
> Thank you very much for your work, it's an excellent framework and
> there are a lot of documents, that's why I have used it for four years
> and this is the first time that I ask you.
>
> I'm Trying to search in a postgis layer, but it does not work, in the
> same project I do the search in a shapefile file and it works, I've
> tested with two different layers with options and autocomplete, but it
> never works. I check log files Apache and PostgreSQL and says that the
> problem maybe in the query, this is the detailed information about the
> project, mapfile, xml and logs:
>
> 1. Information about the plataform, versions of framework and others:
> Ubuntu Linux 11.04
> Pmapper 4.0 and I tried also with the same problem 4.2
> PostgreSQL 8.4.8
> PostGIS 1.5.2
> Mapserver: 5.6.1
> URL: http://conflictosdeuso.igac.gov.co
>
>
> 2. Mapfile definitions
>
> ###################################  1.26 Humedales RAMSAR
> ######################################
>
>    LAYER
>      NAME 'geom_humedales_ramsar'
>      TYPE POLYGON
>      DUMP true
>      TEMPLATE 'void'
>      EXTENT -77.37598 4.77270 -74.09433 11.08333
>      CONNECTIONTYPE postgis
> PROCESSING "CLOSE_CONNECTION=DEFER"
>      CONNECTION "dbname='data' host=localhost port=5432 user='user'
> password='passwd"
>      DATA 'the_geom FROM "geom_humedales_ramsar" USING UNIQUE gid USING
> srid=4326'
>      METADATA
>               "DESCRIPTION" "Humedales Ramsar"
>       "RESULT_FIELDS" "etiqueta,nombre"
>       "RESULT_HEADERS" "Etiqueta,Nombre"
>       "wms_title"      'geom_humedales_ramsar'
>       "wms_srs"       "EPSG:4326"
>       "LAYER_ENCODING" "UTF-8"
>      END
>      STATUS OFF
>      TRANSPARENCY 100
>      CLASS
>         NAME 'Humedal Ramsar'
>         STYLE
>           SYMBOL 0
>           SIZE 7.0
>           COLOR 0 0 255
>         END
>      END
>    END
>
> #############################     Capa simplificada de suelos escala
> 1:100.000    ################################
>
>
>    LAYER
>      NAME 'geom_suelos_simplificado'
>      TYPE POLYGON
>      DUMP true
>      TEMPLATE 'void'
>    EXTENT -85.545616 -0.110922 -67.302864 13.724064
>      CONNECTIONTYPE postgis
> PROCESSING "CLOSE_CONNECTION=DEFER"
>      CONNECTION "dbname='dbuso' host=localhost port=5432 user='user'
> password='passwd' sslmode=disable"
>      DATA 'the_geom FROM "geom_suelos_simplificado" USING UNIQUE gid
> USING srid=4326'
>      METADATA
>       "DESCRIPTION" "Suelos Simplificado"
>       "RESULT_FIELDS" "sim_nuevo1,sim_anti1"
>       "RESULT_HEADERS" "Símbolo,Símbolo Estudio"
>       "wms_title"      "geom_suelos_simplificado"
>       "LAYER_ENCODING" "UTF-8"
>      END
>      STATUS OFF
>      TRANSPARENCY 100
>      CLASS
>         NAME 'Suelo'
>         STYLE
>          SIZE 4
>       WIDTH 2
>           OUTLINECOLOR 155 6 214
>           COLOR 216 209 125
>         END
>      END
>    END
>
>
> 3. Definitions in the config.xml
>
>       <searchitem name="geom_suelos_simplificado" description="Suelos 
> Simplificados">
>          <layer type="postgis" name="geom_suelos_simplificado">
>       <field type="n" name="gid" description="Suelos" wildcard="2">
>                  <definition type="options" connectiontype="ms"
> sort="asc" firstoption="Seleccionar">
>               <mslayer keyfield="gid" showfield="sim_nuevo1"
> encoding="latin1"/>
>                  </definition>
>          </field>
>          </layer>
>       </searchitem>
>
>       <searchitem name="geom_humedales_ramsar" description="Humedales">
>          <layer type="ms" name="geom_humedales_ramsar">
>       <field type="s" name="nombre" description="Humedales" wildcard="0">
>                  <definition type="suggest" connectiontype="ms"
> minlength="1" startleft="1" sort="asc">
>               <mslayer encoding="latin1"/>
>                  </definition>
>          </field>
>          </layer>
>       </searchitem>
>
>
> 4. Logs, the say the same error, the problem is in the query.
>
> 2011-09-20 11:23:54 COT ERROR:  error de sintaxis en o cerca de «)» en
> carácter 420 (Syntax error near ")" in character 420)
> select 
> "gid","nombre","tipo_ap","etiqueta","shape_area","shape_len",encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'hex')
> as geom,"gid" from "geom_humedales_ramsar" where the_geom&&
> GeomFromText('POLYGON((-86.018393 -4.655442,-86.018393
> 14.407375,-63.478399 14.407375,-63.478399 -4.655442,-86.018393
> -4.655442))',4326) and ( ( "[nombre]" =~ ^(A|a) ) )
>
> 2011-09-20 11:23:41 COT ERROR: error de sintaxis en o cerca de «)» en
> carácter 367 (Syntax error near ")" in character 367)
> select 
> "gid","id","sim_anti_1","depto","sim_nuevo1","area_1","vocacion","descripcio","grupo","capacidad_","shape_leng","shape_area","orig_fid",encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'hex')
> as geom,"gid" from "geom_suelos_simplificado" where the_geom&&
> GeomFromText('POLYGON((-86.018393 -4.655442,-86.018393
> 14.407375,-63.478399 14.407375,-63.478399 -4.655442,-86.018393
> -4.655442))',4326) and (())
>
>
> I'll apreciate your help with this topic, I know that it's strange
> that it fails, because I used similar definitios used in the examples.
>
> Thank you very much.
>
> Ricardo Cuítiva
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> pmapper-users mailing list
> pmapper-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to