[postgis-users] Cannot display postGIS layers on ms4w 4.6.1

kreshna_iceheart at yahoo.com kreshna_iceheart at yahoo.com
Thu Apr 3 21:34:47 PDT 2008


I'm trying to display postGIS layers on MapServer. I
am using the following components:
1) MapServer 4.6.1 for Windows (ms4w)
2) postgreSQL 8.2
3) shp2pgsql release 1.1.6
4) QuantumGIS 0.9.2 to automatically generate my
mapfile

My mapfile is attached with this email. It only has a
single layer (for testing purpose), and it does not
contain any complex query at all. The layer definition
is as follows:
=======================================================
  LAYER
    NAME 'batas_administrasi_line2_utm'
    TYPE LINE
    CONNECTIONTYPE postgis
    CONNECTION 'host=localhost user=rtrw
dbname=rtrw-pacitan-trenggalek'
    DATA 'the_geom FROM
batas-admin.batas_administrasi_line2_utm'
=======================================================


Yet, when I tried to display the mapfile, I got the
following error message:
=======================================================
msDrawMap(): Image handling error. Failed to draw
layer named 'batas_administrasi_line2_utm'. 
prepare_database(): Query error. Error executing
POSTGIS DECLARE (the actual query) statement: 'DECLARE
mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text
from batas-admin.batas_administrasi_line2_utm WHERE ()
and (the_geom && setSRID( 'BOX3D(528656.510416667
9074209,609071.177083333
9134520)'::BOX3D,find_srid('','batas-admin.batas_administrasi_line2_utm','the_geom')
))' 

Postgresql reports the error as 'ERROR: syntax error
at or near "-" at character 116 '

More Help:

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

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

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

Mappostgis.c - version of Jan 23/2004. 
=======================================================

I have tried the following solution:

(1) changing "FROM" to "from" (uppercase to lowercase)

(2) enabling oid in my database:
- uncommenting the line "default_with_oids" in my
postgresql.on
- changing the value to "on"
- restarting posgresql
- re-creating all my postGIS tables


Yet none of the solution above work. MapServer just
keeps giving me the error message.

What happens? Anyone know a working solution?

Thanks,
-Kresh



     
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one
month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

__________________________________________________________________
So be it. If saying "NO" means being alone, then to hell with love, with women, with marriage, with God, religions, bars, nightclubs, computer games, and all the shit life keeps pumping at me. I'll walk alone, but with freedom and a healed pride.


      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtrw-pacitan-trenggalek1.map
Type: application/octet-stream
Size: 2994 bytes
Desc: 165038048-rtrw-pacitan-trenggalek1.map
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080403/38e12258/attachment.obj>


More information about the postgis-users mailing list