[postgis-users] Multiple Geometries in Single View

Rémi Cura remi.cura at gmail.com
Mon Oct 28 08:20:00 PDT 2013


Hey,
as far as I know you cant load directly different geometry type into qgis (
http://trac.osgeo.org/qgis/ticket/167).

If you have a table with different type in in (point, line, polygon), qgis
will ask you to chose which geometry you want to load.
If you have a table with a column with "geometry collection", qgis won't
load it.

This being said, it is easilly worked around (still a hassle) :
simple : if you have a column with different geometry type, load it
multiple time in qgis selecting each time a different geometry type
simple : if you have a column with geometry collection : use
ST_CollectionExtract to be in the previous case

Note:  if you are tired of selecting the type of geometry in qgis, you can
create view with only one type of geometry.

dirty way : simply convert everything to polygon ! : use ST_Buffer with
small area to convert point and line to polygon.

Don't hesitate if you need more details.
Cheers,
Rémi-C


2013/10/28 Wesley Roberts <jwesroberts at gmail.com>

> Dear PostGIS users,
>
> I am a new postgis user and have a question regarding views and multiple
> geometry types. I understand that I can create a *view* where I select a
> portion of my data using an sql statement and view that *view *in QGIS. I
> would like to know if it is possible to create a *view *that contains
> multiple geometry types, so for example: a view displaying points lines and
> polygons from different tables within the my db?
>
> The context to this question is as follows. Our organization needs to
> share a number of GIS layers with an auditor as part of our validation
> process. Instead of sending the auditor a "bucket load" of shapefiles with
> instructions on what to look at, I would prefer to share one postGIS DB
> with all the layers in tables and all of our geo-spatial requirements in
> views. Is this possible?
>
> Many thanks and looking forward to your responses.
> Wesley
>
> --
> Dr Wesley Roberts
> jwesroberts at gmail.com
> Cell: +27(0)83 5355 646
> skype: roberts-w
>
> I hear...I forget
> I see...and I remember
> I do...and I understand
> Ancient Chinese Proverb
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20131028/d7a25a24/attachment.html>


More information about the postgis-users mailing list