[postgis-users] How to make some geometry column visible to Qgis

Sandro Santilli strk at keybit.net
Thu Oct 18 08:21:42 PDT 2012


The fastest way for qgis to access the data is by finding the geometry type
and srid information in geometry_columns. The info will automatically get
there if you divide your geometries in multiple tables, each with a single
type of geometries, and with the geometry field appropriately typed. 
Something like:

 CREATE TABLE dxf_poly AS
 SELECT id, ST_Multi(geom)::geometry(multipolygon, 4326)
 FROM dxf_all WHERE geometrytype(ST_Multi(geom)) = 'MULTIPOLYGON';

And so on with other types.

Note that separating the geometries would also make better use of statistics
(used by the planner).

--strk;

 http://www.cartodb.com - Map, analyze and build applications with your data

                                       ~~ http://strk.keybit.net 


On Thu, Oct 18, 2012 at 04:19:48AM -0700, Pieri70 wrote:
> Hi all
> I'm migrating a thousand of dxf files to postgis.
> After some test I was able to load 30% of my dxf and I was testing Quantum
> Gis to load data.
> Quantum recognizes the geometry column of the main table (entities) and
> takes a lot to distinguish which geometry is in there. That is a mixed point
> and lines column.
> My idea is to query the layer column and create a view for any layer, this
> way I hope that Qgis will read data much faster. Is that correct?
> But, if the main geometry column remains accessible to Quantum my solution
> will not work because qgis will fetch all the database instead of the views,
> right?
> 
> If so, is there some way to hide the main/mixed geometry column?
> Postgis 2/postgres 9
> Thanks
> Pietro
> 
> 
> 
> --
> View this message in context: http://postgis.17.n6.nabble.com/How-to-make-some-geometry-column-visible-to-Qgis-tp5000570.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> _______________________________________________
> 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