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

Jason Burkhardt jburkhardt at usgs.gov
Thu Jul 14 11:00:59 PDT 2005


Thanks for the quick response.
I've tried with just about every combination of lat/long (including -72)
with no results.  I was just using the list here:
http://www.realestate3d.com/gps/uslatlongdegmin.htm so I'm really not sure
if they're all hosed or what.  My current viewer's extents extend from
central america up to the north pole so I figured I would have hit
something in the area by now ;)
I modified my .map file as per your suggestions to look like this:
        CONNECTION "user=postgres password=pgadmin dbname=test
host=localhost port=5432"
        DATA "point from cities using unique oid using SRID=4326"
I assume that's what you meant for the DATA clause.  I know for sure that
MapServer is connecting to the database & executing the queries, I can see
as much in the PostgreSQL logs.
If I set the layers status to default it's turned off when I load up my
viewer & I'm still unable to display it when I turn it on and refresh the
viewer.

Jason





|---------+--------------------------------------------->
|         |           Nicolas Ribot <nicky666 at gmail.com>|
|         |           Sent by:                          |
|         |           postgis-users-bounces at postgis.refr|
|         |           actions.net                       |
|         |                                             |
|         |                                             |
|         |           07/14/2005 01:45 PM               |
|         |           Please respond to Nicolas Ribot;  |
|         |           Please respond to PostGIS Users   |
|         |           Discussion                        |
|---------+--------------------------------------------->
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                                  |
  |       To:       PostGIS Users Discussion <postgis-users at postgis.refractions.net>                                                                 |
  |       cc:                                                                                                                                        |
  |       Subject:  Re: [postgis-users] Trouble getting PostGIS data to display in    MapServer                                                      |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|




Hi Jason,

Just some thoughts:

try to explicitly add PG port in your connection string (5432 is the
default)
try to set the layer's status to DEFAULT in order to force its display.
in your DATA clause, maybe try adding "using unique oid using SRID=4326".

Are you sure your points' extent fall in your mapserver map extent ?
Shouldn't Albany's longitude be -72 instead of 72 (West from greenwich
?)

Nicolas


On 7/14/05, Jason Burkhardt <jburkhardt at usgs.gov> wrote:
> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list