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

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Fri Apr 4 02:24:59 EDT 2008


Perhaps a typo in your mapfile? There reads:

    DATA 'the_geom from batas-admin.batas_administrasi_line2_utm using unique oid'

-Jukka Rahkonen-


> -----Alkuperäinen viesti-----
> Lähettäjä: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta 
> kreshna_iceheart at yahoo.com
> Lähetetty: 4. huhtikuuta 2008 7:28
> Vastaanottaja: mapserver-users at lists.osgeo.org
> Aihe: [mapserver-users] Cannot display postGIS layers on ms4w 4.6.1
> 
> 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
> 


More information about the mapserver-users mailing list