[UMN_MAPSERVER-USERS] Problems displaying PostGIS Layer

Skweda O'Bomsawin sobomsawin at KASSINI.COM
Wed Jan 12 09:15:06 PST 2005


Hi William!

I'd first recommend you to create an index for your Postgis layer:
CREATE INDEX us_cities_idx ON us_cities USING GIST (the_geom
GIST_GEOMETRY_OPS);

Second, since your layer is using SRID 4326, make sure you have a PROJECTION
bloc correctly set in your MAP section of you mapfile.  Otherwise, you must
have a PROJECTION bloc in your LAYER section...

Skweda


-----Message d'origine-----
De : UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] De la
part de William Hudspeth
Envoyé : 12 janvier 2005 11:28
À : MAPSERVER-USERS at LISTS.UMN.EDU
Objet : [UMN_MAPSERVER-USERS] Problems displaying PostGIS Layer

Hello,

I have imported a shapefile into PostGIS with the following:

./shp2pgsql –s 4326 /path/us_cities.shp us_cities –d reason | ./psql –d
reason

The new table has a "gid" column as well as a populated geometry column
named "the_geom".
My map file entry looks like this:

****************************
LAYER
        CONNECTIONTYPE postgis
        NAME "us_cities"
        CONNECTION "user=postgis dbname=reason host=falstaff.unm.edu"
        DATA "the_geom from us_cities"
        STATUS OFF
        TYPE POINT

        CLASS
                COLOR 177 213 34
                SIZE 7
                SYMBOL "circle"
        END
END
********************************
The layer does not display. I get the following error in my Apache error
log:

[Wed Jan 12 08:47:48 2005] [error] [client 129.24.73.222]
_mapscript.MapServerError: msDrawMap(): Image handling error. Failed to
draw layer named 'us_cities'., referer: http://falstaff.unm.edu/cgi-
bin/reason/python_mapscript.py
[Wed Jan 12 08:47:48 2005] [error] [client 129.24.73.222] prep_DB():
Query error. Error executing POSTGIS DECLARE (the actual query)
statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT asbinary
(force_collection(force_2d(the_geom)),'NDR'),gid::text from us_cities
WHERE the_geom && setSRID('BOX3D(-125.000000000, referer:
http://falstaff.unm.edu/cgi-bin/reason/python_mapscript.py


I would appreciate any insight into this problem.

Thanks, Bill

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 2005-01-10
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 2005-01-10
 



More information about the MapServer-users mailing list