[postgis-users] Update to where clause errors

David Blasby dblasby at refractions.net
Tue May 27 09:15:08 PDT 2003


Paul A Peters wrote:
> 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>

The message : Function 'force_2d(point)'

indicates you're probably using the built-in postgresql datatypes NOT 
PostGIS types.  How did you get your data into the database?

You can test this by opening up psql and typing:

\d gis_test

If the shape type is 'point' you're using the old postgresql datatypes. 
  If it says 'geometry' you're using a PostGIS type - unfortunately this 
would indicate that something is wrong with your installation.

dave




More information about the postgis-users mailing list