Error load from database

Luis Treviño Huerta ltrevino at GPOBSI.COM.MX
Wed Mar 22 07:59:41 PST 2006


Alexander,

Try:  DATA "the_geom from contornos as foo using unique oid using srid=-1"

Saludos
Luis

----- Original Message ----- 
From: "Alexander Rodriguez Torres" <atorres at ESTUDIANTES.UCI.CU>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Tuesday, March 21, 2006 10:28 AM
Subject: [UMN_MAPSERVER-USERS] Error load from database


I have these error when I load my map from database. Can you help me???

****************************************************************************
msDrawMap(): Image handling error. Failed to draw layer named 'Contornos'.
prep_DB(): Query error. Error executing POSTGIS DECLARE (the actual query) 
statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT 
contornos::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text 
from contornos WHERE the_geom && setSRID('BOX3D(9387137.4 
791043.7018,10119140.81 1522550.8382)'::BOX3D, 
find_srid('','contornos','the_geom') )'

Postgresql reports the error as 'ERROR: cannot cast type contornos to text '
****************************************************************************

This is my .map

MAP
  NAME "Mapa de la UCI"
  STATUS ON
  EXTENT 9387137.4 805683.77 10119140.81 1507910.77
  SIZE 500 500
  SHAPEPATH "./data"
  SYMBOLSET "./etc/symbols.sym"
  FONTSET "./etc/fonts.txt"
  IMAGETYPE PNG
  IMAGECOLOR 174 183 207
  UNITS METERS
  TEMPLATEPATTERN "UCI"
  WEB
    MINSCALE 259371
    IMAGEPATH "C:/temp/"
    IMAGEURL "/tmp/"
    HEADER "templates/header.html"
    FOOTER "templates/footer.html"
 END
  REFERENCE
    STATUS ON
    IMAGE "images/keymap.png"
    SIZE 88 69
    EXTENT 9387137.4 805683.77 10119140.81 1507910.77
    COLOR -1 -1 -1
    OUTLINECOLOR 255 0 0
    MINBOXSIZE 3
    MAXBOXSIZE 0
    MARKER 0
    MARKERSIZE 0
  END
  QUERYMAP
    STATUS OFF
    SIZE -1 -1
    COLOR 255 0 0
    STYLE HILITE
  END
  #
  # Start of legend object
  #
  LEGEND
    STATUS ON
    IMAGECOLOR 255 255 255
    POSITION LL
    KEYSIZE 18 12
    KEYSPACING 5 5
    TEMPLATE "ttt"
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      OFFSET 0 0
      BUFFER 0
      MINDISTANCE -1
      MINFEATURESIZE -1
      COLOR 0 0 89
      PARTIALS TRUE
      FORCE FALSE
    END
  END
  #
  # Start of scalebar object
  #
  SCALEBAR
    STATUS ON
    COLOR 255 255 255
    OUTLINECOLOR 0 0 0
    BACKGROUNDCOLOR 0 0 0
    IMAGECOLOR 255 255 255
    UNITS KILOMETERS
    INTERVALS 5
    SIZE 150 5
    STYLE 0
    POSITION LL
    LABEL
      TYPE BITMAP
      SIZE SMALL
      OFFSET 0 0
      BUFFER 0
      MINDISTANCE -1
      MINFEATURESIZE -1
      COLOR 0 0 0
      PARTIALS TRUE
      FORCE TRUE
    END
  END
  #
  # Start of OutputFormat object
  #
  OUTPUTFORMAT
    NAME "png"
    MIMETYPE "image/png"
    DRIVER "GD/PNG"
    EXTENSION "png"
    IMAGEMODE PC256
    TRANSPARENT FALSE
  END
  LAYER
    NAME "Contornos"
    STATUS ON
    CONNECTIONTYPE POSTGIS
    CONNECTION "user=postgres password=post dbname=siguci host=localhost"
    CLASSITEM "contornos"
    DATA "the_geom from contornos"
    TYPE POLYGON
    CLASS
      NAME "contornos"
      TEMPLATE ""
      STYLE
        SYMBOL 0
        COLOR 0 128 0
        OUTLINECOLOR 0 0 0
      END


    END

Alexander Rodríguez Torres.
 Estudiante de Quinto Año.
  Universidad de las Ciencias Informáticas.
   E-mail:atorres at estudiantes.uci.cu 



More information about the MapServer-users mailing list