[postgis-users] Trouble getting PostGIS data to display in MapServer

Jason Burkhardt jburkhardt at usgs.gov
Thu Jul 14 10:21:38 PDT 2005


I'm really sure this must be something simple I'm missing, but I'm at my
wits end and am not getting any further by staring at it.  Hopefully a
fresh set of eyes can help me out.
I'm running MapServer & have a viewer up displaying data from a variety of
sources (WMS, .tif's, shapefiles) and would like to include PostGIS data.
I created a simple PostgreSQL db with a table called cities (this table was
created with oids) that has a name, state_name and point field.
I created the point field as such:
      select AddGeometryColumn('cities', 'point', 4326, 'POINT', 2);
A sample of the data I'm inserting looks like this:
      insert into cities (name, state, point) values('Albany', 'NY',
GeometryFromText('POINT(73 42)',4326));

I then created 2 indexes as so:
      CREATE INDEX cities_index ON cities USING GIST (point
GIST_GEOMETRY_OPS)
      CREATE INDEX cities_index_oid ON cities (name)
I've also done the second index with point as the unique column, I don't
really care which it is at this point.

Onto MapServer my layer definition looks like this:
LAYER
  CONNECTIONTYPE postgis
  CONNECTION "user=postgres password=pgadmin dbname=test host=localhost"
  DATA "point from cities"
  NAME "PostGIS Cities Test"
  TYPE POINT
  STATUS ON
  CLASS
      COLOR 255 0 0
      SIZE 50
  END
  PROJECTION
    "init=epsg:4326"
  END
END

Every other layer I have is also 4326.  It's connecting to the database &
not throwing any errors that I can see from the PostgreSQL logs (I've run
them with varying levels of verbosity).  MapServer does not return a broken
image when the layer is turned on, I just don't see the point displayed.
I would appreciate any comments/insight.

Thanks,
Jason




More information about the postgis-users mailing list