[postgis-users] Re: [mapserver-users] Mapserver and PostgreSQL

Sean Gillies sgillies at frii.com
Fri Nov 22 07:34:35 PST 2002


You _can_ use views.  We added this is 3.6.  I had a need
in an application to use OGIS-complient views of non-
compliant tables and so we came up with the 'using unique
<column>' direction which will permit use of views.

For example, say you have a table ('ftab') with a geometry column
and an attribute ('geom' and 'attr'), you can create a
view like:

    create view fview as select oid as uid, geom, attr from ftab;

and then you use it in mapserver as a layer like

    DATA "geom from fview using unique uid"

Of course, you'll need to make sure that there is a proper
row for fview in the geometry_columns table of the database,
or specify SRID in the DATA line.


Vinko Vrsalovic wrote:

> On Thu, Nov 21, 2002 at 05:27:11PM -0800, Paul Ramsey wrote:
> >Is PostGIS preferable to shape files? Depends on what your needs are.
> >Jan gave a pretty good summary of the kinds of higher level things you
> >can do with PostGIS which you cannot do with shape files. When it comes
> >to performance, (spatially indexed) shapefiles are unbeatable. When it
> >comes to application flexibility, a PostGIS-based application is hard to
> >beat.
> I agree on that last one, but I miss the ability to create Mapserver
> layers from PostgreSQL/PostGIS views. Is there a plan to support that 
> anytime
> soon?
> Thanks,

More information about the postgis-users mailing list