[postgis-users] Update to where clause errors

Paul A Peters papeters at fes.uwaterloo.ca
Tue May 27 08:36:38 PDT 2003


Thanks for the responses thus far. When I run shp2img I get the error
attached below. I ran though the wiki for postgis on the MapServer website
and I can access the database fine with that user, so I can't seem to narrow
the problem down there. I can't really make out too much from the error
message below. Maybe someone else will have some suggestions.

thanks,
Paul

-------------------------------------------------
C:\Inetpub\Scripts>shp2img -m C:\msapps\projects\Independencia.map -o
out.png prep_DB(): Query error. Error executing POSTGIS  DECLARE (the actual
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(shape)),'NDR'),OID::text from gis_test
WHERE shape && setSRID('BOX3D(273346 8670666,281455 8677412)'::BOX3D,
find_srid('','gis_test','shape') )' <br><br>

Postgresql reports the error 'ERROR:  Function 'force_2d(point)' does not
exist
        Unable to identify a function that satisfies the given argument
types
        You may need to add explicit typecasts
'<br><br>

More Help:<br><br>

Error with POSTGIS data variable. You specified '<check your .map
file>'.<br>
Standard ways of specifiying are : <br>
(1) 'geometry_column from geometry_table' <br>
(2) 'geometry_column from (<sub query>) as foo using unique <column
name> using SRID=<srid#>' <br><br>

Make sure you put in the 'using unique  <column name>' and 'using
SRID=#' clauses in.

<br><br>For more help, please see
http://postgis.refractions.net/documentation.php

<br><br>Mappostgis.c - version of Nov 15/2002.
-------------------------------------------------

This is when I am using the .map file:

-------------------------------------------------
MAP
  EXTENT 273346 8670666 281455 8677412
  FONTSET "./Independencia/etc/fonts.txt"
  IMAGECOLOR 255 255 255
  IMAGEQUALITY 100
  IMAGETYPE PNG
  INTERLACE TRUE
  SYMBOLSET "./Independencia/etc/symbols.sym"
  SHAPEPATH "./Independencia"
  SIZE 600 500
  STATUS ON
  TRANSPARENT FALSE
  UNITS METERS
  NAME "Independencia"

  LEGEND
    IMAGECOLOR 204 204 255
    INTERLACE TRUE
    KEYSIZE 18 12
    KEYSPACING 5 5
    LABEL
      SIZE MEDIUM
      TYPE BITMAP
      BUFFER 0
      COLOR 0 0 89
      FORCE FALSE
      MINDISTANCE -1
      MINFEATURESIZE -1
      OFFSET 0 0
      PARTIALS TRUE
    END
    OUTLINECOLOR 0 0 0
    POSITION LL
    STATUS ON
    TRANSPARENT FALSE
    TEMPLATE "c:/msapps/htdocs/mapedit/legend_template.html"
  END

  QUERYMAP
    COLOR 51 100 255
    SIZE -1 -1
    STATUS OFF
    STYLE HILITE
  END

  REFERENCE
    COLOR -1 -1 -1
    EXTENT 272051 8670801 282750 8677277
    IMAGE "./vista.gif"
    OUTLINECOLOR 255 0 0
    SIZE 100 60
    STATUS ON
      MARKER 0
      MARKERSIZE 0
      MINBOXSIZE 3
      MAXBOXSIZE 0
  END

  SCALEBAR
    BACKGROUNDCOLOR 204 204 204
    COLOR 0 0 0
    IMAGECOLOR 255 255 255
    INTERLACE TRUE
    INTERVALS 5
    LABEL
      SIZE MEDIUM
      TYPE BITMAP
      BUFFER 0
      COLOR 0 0 0
      FORCE FALSE
      MINDISTANCE -1
      MINFEATURESIZE -1
      OFFSET 0 0
      PARTIALS TRUE
    END
    OUTLINECOLOR 0 0 0
    POSITION LL
    SIZE 300 8
    STATUS ON
    STYLE 0
    TRANSPARENT FALSE
    UNITS KILOMETERS
  END

  WEB
    IMAGEPATH "c:/tmp/ms_tmp/"
    IMAGEURL "/ms_tmp/"
  END
  
  LAYER
    CONNECTIONTYPE postgis
    CONNECTION "user=Internet password=Manzana dbname=edumap host=localhost"
    DATA "shape FROM gis_test"
    FILTER "cod_mod > 0"
    GROUP "Independencia"
    NAME "Escuelas Primarias"
    SIZEUNITS PIXELS
    STATUS ON
    TEMPLATE "ttt.html"
    TOLERANCE 3
    TOLERANCEUNITS PIXELS
    TYPE POINT
    UNITS METERS
    CLASS
      NAME "Escuelas"
      COLOR 150 0 0
      MAXSIZE 100
      MINSIZE 1
      SIZE 8
      SYMBOL 2
    END
  END

END
-------------------------------------------------



Paul A Peters
http://www.fes.uwaterloo.ca/u/papeters




More information about the postgis-users mailing list