[mapserver-users] Error Creating View...

João Mário joao at pmpf.rs.gov.br
Tue Nov 26 11:58:25 EST 2002


Hello to all

I'm using PostGIS and Mapserver  versions 0.7.3 and  3.6.3.

I'm tried to create a view  from the main table and call it in the 
mapfile, but it doesn't work....

The code is this:

LAYER
  CONNECTIONTYPE postgis
  NAME Roads
  CONNECTION "user=postgres dbname=dbase"
  DATA "geometry_field  from table_view"
  FILTER "id_sec=1"
  STATUS  ON
  TYPE LINE
#  LABELITEM "tile_name"
  CLASS
   NAME "Road 1"
   TEMPLATE "Road_1.html"
   EXPRESSION ([tipo_log]=2)
   COLOR 85 85 85
   SYMBOL 'line'
   SIZE 10
   MINSIZE 3
   MAXSIZE 15
   OVERLAYCOLOR 168 168 0
   OVERLAYSYMBOL 0
   OVERLAYSIZE 3
   OVERLAYMINSIZE 1
   OVERLAYMAXSIZE 2
   SIZE 15
  # LABEL
  #  TYPE truetype
  #  FONT arial-bold
  #  SIZE 14
  #  ANTIALIAS
  #  COLOR 0 0 0
  #  OUTLINECOLOR 255 255 255
  #  PARTIALS OFF
  END
  CLASS
    NAME "Road"
    TEMPLATE "Road_2"
    EXPRESSION ([tipo_log]=1)
    COLOR 85 85 85
    SYMBOL 'line'
    SIZE 5
    MINSIZE 3
    MAXSIZE 15
    OVERLAYCOLOR 255 255 255
    OVERLAYSYMBOL 0
    OVERLAYSIZE 3
    OVERLAYMINSIZE 1
    OVERLAYMAXSIZE 2
    SIZE 15
  END
END

when i execute the following error apears:

msPOSTGISLayerWhichShapes(): Query error. prep_DB:Error executing 
POSTGIS DECLARE statement (0.6 failed - retried 0.5 and it failed too). 
DECLARE mycursor BINARY CURSOR FOR SELECT 
tipo_log::text,asbinary(force_collection(force_2d(geometry_field)),'NDR'),OID::text 
from table_view WHERE (id_sec=1) and (geometry_field && setSRID( 
'BOX3D(1430.3002 760.3,1730.1002 
1120.3)'::BOX3D,find_srid('','table_view','geometry_field') ))

What could be wrong?

Thanks

João




More information about the mapserver-users mailing list