[Qgis-user] some report and questions on our QGIS training
Hi, Just want to give some feedback regarding the use of QGIS for a one-day training/workshop we gave last month. The workshop was designed as an introduction to QGIS for beginner (new to FOSS-Geo and GIS in general). We used QGIS-1.4.0-1-No-GrassSetup for the course. It covers the basic topics outlined below: * displaying and navigating data, * creating and editing data, * vector geoprocessing and overlay analysis and, * designing maps for printing. Overall, I believe the participants appreciated the power of GIS and QGIS as an additional tool within their respective organizations. Below are some feedback/request from the participants I hope devs can look into in the future (or perhaps this has been solved already): * Install problems with Windows 7 and Vista - It seems QGIS cannot be installed to default Program Files(86) directory. When using Vista and Win7 (using the QGIS-1.4.0-1-No-GrassSetup.exe), the install process ran and finishes, however, when we started the QGIS using the Desktop icon, no QGIS session was opened. When we checked the the Program Files directory, no QGIS folder was created. We had to create a QGIS directory in C:\ to install QGIS. In Windows XP, installation worked as expected. * Participants using small screen netbooks have difficulty using some of the QGIS application windows. For example, the field calculator window is not completely visible using a 10.5 inch LCD screen. * Saving file in a specified format does not append the file extensions. This was observed in the Map/Print Composer. Although a pdf filetype was activated, we had to create a complete filename with the extension (i.e "map.pdf" and not "map") in order to save the file with the extension. * Feature requests for batch spatial index generation. When loading multiple shapefiles, you need to open the Properties dialog to create shapefile index (qix) for each layer. A nice plugin/feature would be to create qix for all active layers. Now for some questions. Two useful materials I used was the QGIS 1.4 user guide and "A Gentle Introduction to GIS" (T. Sutton, O. Dassau, M. Sutton) both materials are in GNU Free Documentation License. In some cases, portions of text from the two materials are integrated into our exercise materials. What aspects of the GFDL should I be complying with? In my opinion, the exercises are covered under section 7 (Aggregation with Independent Works) of the license. Thanks again fro QGIS (couple with GRASS), I have been using it in almost all of our GIS needs and we see it as an appropriate app for advocating the use of FOSS-Geo in our country (PH). -- cheers, maning -- "Freedom is still the most radical idea of all" -N.Branden wiki: http://esambale.wikispaces.com/ blog: http://epsg4253.wordpress.com/ -- ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] Re:postgis layer from a view
Hi Lionel, try a query like this: select count(gid) from group by gid having count(gid)>1 to see if there is some duplicates. Regards, Andrea. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] postgis layer from a view
Dear Lionel, I guess the problem is that you join spatial.commune at residentiel.nrj_sourcesfixes. If this is a n:1 or n:m - join, gids appear several times, thus gid is not unique (postgis provider tells you). Try using residentiel.nrj_sourcesfixes' (or one of its underlying tables') primary key in the view (just a shot in the dark) in order to get unique pk-values. On the other hand consider if it makes sense that the same geometry is allowed to be contained several times. How do you want to show this in QGIS? One way to avoid this would be to join residentiel.nrj_sourcesfixes at spatial.commune but then you will have fewer datasets than now. Try to analyze which gids are contained more than once and why. Benno Lionel Roubeyrie schrieb: Hi Bernhard, thanks to responding. I have modified the view to retrieve the "gid" column form a table, which is a primary key with unique values, and not from a sequence, but postgis provider complains again about no unique values oO Here is the table : CREATE TABLE spatial.commune ( code_insee character varying(5), region character varying(20), the_geom geometry, gid serial NOT NULL, CONSTRAINT commune_pkey PRIMARY KEY (gid), CONSTRAINT commune_gid_key UNIQUE (gid), CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2), CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL), CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 2154) ) and the problematic view : CREATE OR REPLACE VIEW residentiel.spatial_nrj_sourcesfixes AS SELECT com.gid, nrj.id, nrj.cmbl, nrj.commune, nrj.region, nrj.cha, nrj.ecs, nrj.cui, nrj.spe, nrj.total, com.the_geom FROM residentiel.nrj_sourcesfixes nrj JOIN spatial.commune com ON nrj.commune::text = com.code_insee::text; the residentiel.nrj_sourcesfixes is another view. 2010/6/1 Bernhard Ströbl : Dear Lionel, AFAIK the view must contain a field being defined as primary key in the underlying table, moreover this field must be of type integer. The view must be defined in a way that every element (thus every primary-key value) is unique. In case the view contains a join resulting in several primary-key fields you can choose which one QGIS should use. So your view definition lacks the primary-key field, although the sequence - of course - populates gid with unique values. Maybe you could post the complete view definition (and the table definitions, too) and we could see if we could help you in creating a working view. regards Benno Lionel Roubeyrie schrieb: Hi all, I can't load datas from a postgis view, the loader complains about no uniques values and int4 type, however the view starts with "SELECT nextval('my_seq'::regclass)::integer AS gid, com.the_geom, ..." (the gid column is not listed in the error message) which works perfectly if datas are stored in a table. Is there a trick to load datas from views, and more generally is it possible to force the postgis provider to create an internal unique key? Thanks Information from NOD32 This message was checked by NOD32 Antivirus System for Linux Mail Server. http://www.nod32.com Information from NOD32 This message was checked by NOD32 Antivirus System for Linux Mail Server. http://www.nod32.com ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] postgis layer from a view
Hi Bernhard, thanks to responding. I have modified the view to retrieve the "gid" column form a table, which is a primary key with unique values, and not from a sequence, but postgis provider complains again about no unique values oO Here is the table : CREATE TABLE spatial.commune ( code_insee character varying(5), region character varying(20), the_geom geometry, gid serial NOT NULL, CONSTRAINT commune_pkey PRIMARY KEY (gid), CONSTRAINT commune_gid_key UNIQUE (gid), CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2), CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL), CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 2154) ) and the problematic view : CREATE OR REPLACE VIEW residentiel.spatial_nrj_sourcesfixes AS SELECT com.gid, nrj.id, nrj.cmbl, nrj.commune, nrj.region, nrj.cha, nrj.ecs, nrj.cui, nrj.spe, nrj.total, com.the_geom FROM residentiel.nrj_sourcesfixes nrj JOIN spatial.commune com ON nrj.commune::text = com.code_insee::text; the residentiel.nrj_sourcesfixes is another view. 2010/6/1 Bernhard Ströbl : > Dear Lionel, > > AFAIK the view must contain a field being defined as primary key in the > underlying table, moreover this field must be of type integer. > The view must be defined in a way that every element (thus every primary-key > value) is unique. In case the view contains a join resulting in several > primary-key fields you can choose which one QGIS should use. > So your view definition lacks the primary-key field, although the sequence - > of course - populates gid with unique values. > Maybe you could post the complete view definition (and the table > definitions, too) and we could see if we could help you in creating a > working view. > > regards > > Benno > > Lionel Roubeyrie schrieb: >> >> Hi all, >> I can't load datas from a postgis view, the loader complains about no >> uniques values and int4 type, however the view starts with "SELECT >> nextval('my_seq'::regclass)::integer AS gid, com.the_geom, ..." (the >> gid column is not listed in the error message) which works perfectly >> if datas are stored in a table. Is there a trick to load datas from >> views, and more generally is it possible to force the postgis provider >> to create an internal unique key? >> Thanks >> > > > Information from NOD32 > This message was checked by NOD32 Antivirus System for Linux Mail Server. > http://www.nod32.com > -- Lionel Roubeyrie lionel.roubey...@gmail.com http://youarealegend.blogspot.com ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] postgis layer from a view
Dear Lionel, AFAIK the view must contain a field being defined as primary key in the underlying table, moreover this field must be of type integer. The view must be defined in a way that every element (thus every primary-key value) is unique. In case the view contains a join resulting in several primary-key fields you can choose which one QGIS should use. So your view definition lacks the primary-key field, although the sequence - of course - populates gid with unique values. Maybe you could post the complete view definition (and the table definitions, too) and we could see if we could help you in creating a working view. regards Benno Lionel Roubeyrie schrieb: Hi all, I can't load datas from a postgis view, the loader complains about no uniques values and int4 type, however the view starts with "SELECT nextval('my_seq'::regclass)::integer AS gid, com.the_geom, ..." (the gid column is not listed in the error message) which works perfectly if datas are stored in a table. Is there a trick to load datas from views, and more generally is it possible to force the postgis provider to create an internal unique key? Thanks Information from NOD32 This message was checked by NOD32 Antivirus System for Linux Mail Server. http://www.nod32.com ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] postgis layer from a view
Hi all, I can't load datas from a postgis view, the loader complains about no uniques values and int4 type, however the view starts with "SELECT nextval('my_seq'::regclass)::integer AS gid, com.the_geom, ..." (the gid column is not listed in the error message) which works perfectly if datas are stored in a table. Is there a trick to load datas from views, and more generally is it possible to force the postgis provider to create an internal unique key? Thanks -- Lionel Roubeyrie lionel.roubey...@gmail.com http://youarealegend.blogspot.com ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user