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

Nicolas Ribot nicky666 at gmail.com
Thu Jul 14 10:45:58 PDT 2005


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
>



More information about the postgis-users mailing list