[postgis-users] PostGIS Layer & MapServer4

Jerod Clabaugh jclabaugh at mac.com
Fri Jul 23 09:42:26 PDT 2004


All:

I am having trouble with PostGIS and Mapserver, specifically the 
display of point data from a table that wasn't converted from a 
shapefile.

With my current set-up (MapServer 4.2.1, Postgres 7.4.1, PostGis 0.81 
on Mac OS X 10.3) I am able to view and query normal shape files, 
PostGIS layers (converted from shapefiles), Raster data, all just 
fine.

I am trying to display point data from a table of species.  I want to 
display all the points associated with genus records in the 
data_specimen table.  The geometry column for this table is called 
'bbox' and is a 2D Point using UTM coordinates.  The specs for the 
data_specimen and geometry_column tables are listed below as well as 
sample data records. Database permissions are working fine.  This 
table was not generated using shp2pgsql but was built from scratch, 
though the same data has been tested to display in standard shapefile 
input format (meaning I had it working as a shapefile first, then 
decided to build a postgres table with just the point data and try it 
as a postgis layer...)

When I use the layer in the map file below, I get no errors, I just 
get no points showing on the map eventhough the 'Aristolochia' class 
shows up in the legend. So I am guessing its either a query problem 
in the map file or something wrong with the geometry column in the 
data_specimen table. Nothing shows up on the map, with or without the 
expression in the CLASS below.  I have even tried the below 
expression with and without capital letters to no avail.

Does anyone know what I am doing wrong here?

Cheers,

Jerod Clabaugh
Belizze Biodiversity Mapping Service
http://www.iwlearn.net/belize

=-=-=-=
Map File layer

LAYER
   CONNECTIONTYPE postgis
    NAME aristo1
    CONNECTION "user=jerod dbname=biodiversity host=localhost"
    DATA "bbox from data_specimen"
    TYPE POINT
    STATUS ON
    DUMP TRUE

    TEMPLATE "aristolochia.html"
    HEADER "aristolochia_header.html"
    FOOTER "aristolochia_footer.html"
    TOLERANCE 5
     CLASSITEM "genus"
      CLASS
       NAME "Aristolochia sp."
       EXPRESSION ('[genus]' eq 'Aristolochia')
       OUTLINECOLOR 75 75 75
       COLOR 39 173 33
       SYMBOL "Triangle"
       SIZE 5
      END
  END
  =-=-=-=

  =-=-=-=
PostgreSQL Database Tables (data_specimen)

TABLE data_specimen (
     specimen_id serial NOT NULL,
     scientificname character varying(50),
     kingdom integer,
     phylum integer,
     class integer,
     order character varying(40),
     family character varying(40),
     genus character varying(40),
     ../ truncated for brevity
     bbox geometry,
     CONSTRAINT "$1" CHECK ((srid(bbox) = 26716)),
     CONSTRAINT "$2" CHECK (((geometrytype(bbox) = 'POINT'::text) OR 
(bbox IS NULL)))
);

==> bbox geometry column data entered as SRID=XXXXX;POINT(XXXXX XXXXX)

Example: 		SRID=26716;POINT( 1797821 298364)

==> There is a GIST index on 'bbox' column and oid index on entire 
'data_specimen' table.

Geometry Table

TABLE geometry_columns (
     f_table_catalog character varying(256) NOT NULL,
     f_table_schema character varying(256) NOT NULL,
     f_table_name character varying(256) NOT NULL,
     f_geometry_column character varying(256) NOT NULL,
     coord_dimension integer NOT NULL,
     srid integer NOT NULL,
     "type" character varying(30) NOT NULL,
     attrelid oid,
     varattnum integer,
     stats histogram2d
);

Data Record for table:

public	data_specimen	bbox	2	26716	POINT	33744	63	\N





More information about the postgis-users mailing list