Re: best.Re: [Qgis-developer] Spatialite ’select ’ statement as vector layer in QGIS

2010-12-13 Thread Ivan Mincik
> What did you mean?
> The RT_Sql_Layer permits to load every PostGIS query, not table based only.
> So I cannot understand, what do you miss in RT_Sql_Layer?

Hi, I wrote example PLPGSQL function, which demonstrates the case
where I was not able to load query using RT SQL Layer. Now it works
perfectly.
So, hats off and thanks You a lot for Your work.

For reference, my test function is attached in this email.

Ivan
DROP TYPE testtype CASCADE;
CREATE TYPE testtype AS 
	(gid integer, the_geom geometry);

CREATE OR REPLACE FUNCTION test_function()
	RETURNS SETOF testtype AS
$BODY$
	BEGIN
		RETURN QUERY SELECT 1 AS gid, '010100F03FF03F'::geometry AS the_geom;
	END;
$BODY$
LANGUAGE plpgsql VOLATILE;


-- run 'SELECT * FROM test_function();'
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: best.Re: [Qgis-developer] Spatialite ’select ’ statement as vector layer in QGIS

2010-12-13 Thread Ricardo Filipe Soares Garcia da
Hi all

> But after upgrading to v. 3.0 I get following traceback when trying to
> load every query in PostGIS (for example: SELECT * from schema.table).

I uploaded v 0.3.1 that (hopefully) fixes the bug you are refering.

I will think about adding Noli's feature requests, which seem
reasonable enough. My initial plan was to have a quick'n'dirty plugin
to query databases, while we waited for a great
postgis/spatialite-super-manager! so I am reluctant to add too much to
this plugin. I would like to polish it a bit more though.
One thing I'd like to implement is having the plugin's window to be
modeless, so that it becomes possible to add and remove layers from
the map canvas without having to close the window.


-- 
___ ___ __
Ricardo Garcia Silva
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: best.Re: [Qgis-developer] Spatialite ’select ’ statement as vector layer in QGIS

2010-12-13 Thread Giuseppe Sucameli
Hi Ivan.

On Sun, Dec 12, 2010 at 11:28 PM, Ivan Mincik  wrote:

> For me the best feature is that it is possible to load
> and visualize every PostGIS query, not only queries based on real
> tables (this is what I miss in perfect 'RT_' plugins).
>
What did you mean?
The RT_Sql_Layer permits to load every PostGIS query, not table based only.
So I cannot understand, what do you miss in RT_Sql_Layer?

Cheers.

-- 
Giuseppe Sucameli
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: best.Re: [Qgis-developer] Spatialite ’select’ statement as vector layer in QGIS

2010-12-12 Thread Paolo Cavallini
Il 12/12/2010 23:28, Ivan Mincik ha scritto:
> But after upgrading to v. 3.0 I get following traceback when trying to
> load every query in PostGIS (for example: SELECT * from schema.table).

> TypeError: QgsDataSourceURI.setDataSource(): argument 1 has unexpected
> type 'NoneType'

I confirm, same here.

-- 
Paolo Cavallini: http://www.faunalia.it/pc
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: best.Re: [Qgis-developer] Spatialite ’select ’ statement as vector layer in QGIS

2010-12-12 Thread Noli Sicad
Hi Ricardo,

Nice plugin.

One suggestion, I think it would be good to add "Table" in the tab so
we can see the attributes of the table we want to queries and
manipulate.

  Query - Table - Result

You can lift / copy the codes from Spatialite Manager and PostGIS
Manager plugins. You can probably put a check box as well for the
Spatiial and PostGIS in the "Table" as well.

The "Preview"? It is one o you if you want to include it as well :-).

Thanks.

Regards, Noli


On 12/13/10, Ricardo Filipe Soares Garcia da
 wrote:
> Hi Paolo, all
>
> Uploaded a new version (v0.3) of the 'Custom DB query' plugin.
>
> I've added it to the 'database' menu. Also, it is now possible to save
> the result of the SQL query as a new table in its corresponding
> database.
>
> So, to summarize, you can run SQL queries over postgis or spatialite
> databases and get the results:
>
> - in a table view
> - as a 'real time' layer displayed over the map canvas
> - as a new table, that gets saved to the database and is immediately
> loaded to the map canvas
>
> It is still pretty raw, so I'm keeping it in the 'experimental'
> section, but it seems to work OK with my small test datasets.
>
>
> --
> ___ ___ __
> Ricardo Garcia Silva
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: best.Re: [Qgis-developer] Spatialite ’select ’ statement as vector layer in QGIS

2010-12-12 Thread Ivan Mincik
On Sun, Dec 12, 2010 at 10:36 PM, Ricardo Filipe Soares Garcia da
 wrote:
> Hi Paolo, all
>
> Uploaded a new version (v0.3) of the 'Custom DB query' plugin.
>
> I've added it to the 'database' menu. Also, it is now possible to save
> the result of the SQL query as a new table in its corresponding
> database.
>
> So, to summarize, you can run SQL queries over postgis or spatialite
> databases and get the results:
>
> - in a table view
> - as a 'real time' layer displayed over the map canvas
> - as a new table, that gets saved to the database and is immediately
> loaded to the map canvas
>
> It is still pretty raw, so I'm keeping it in the 'experimental'
> section, but it seems to work OK with my small test datasets.


Hi Ricardo,
nice plugin. For me the best feature is that it is possible to load
and visualize every PostGIS query, not only queries based on real
tables (this is what I miss in perfect 'RT_' plugins).

But after upgrading to v. 3.0 I get following traceback when trying to
load every query in PostGIS (for example: SELECT * from schema.table).

 Traceback (most recent call last):
 File "/home/ivo/.qgis/python/plugins/customdbquery/CustomDBQueryDialog.py",
line 173, in parse_SQL_text
   self.execute_query(selectQuery)
 File "/home/ivo/.qgis/python/plugins/customdbquery/CustomDBQueryDialog.py",
line 196, in execute_query
   connectionSettings, self.geomField, self.idField)
 File "/home/ivo/.qgis/python/plugins/customdbquery/CustomDBQuery.py",
line 70, in load_to_canvas
   idField, dbSchema)
 File "/home/ivo/.qgis/python/plugins/customdbquery/CustomDBQuery.py",
line 97, in prepare_postgis_uri
   uri.setDataSource(dbSchema, "%s" % query, geomField, '', idField)
TypeError: QgsDataSourceURI.setDataSource(): argument 1 has unexpected
type 'NoneType'

Python version:
2.6.6 (r266:84292, Oct  9 2010, 11:55:20)
[GCC 4.4.5


Ivan
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: best.Re: [Qgis-developer] Spatialite ’select ’ statement as vector layer in QGIS

2010-12-12 Thread Ricardo Filipe Soares Garcia da
Hi Paolo, all

Uploaded a new version (v0.3) of the 'Custom DB query' plugin.

I've added it to the 'database' menu. Also, it is now possible to save
the result of the SQL query as a new table in its corresponding
database.

So, to summarize, you can run SQL queries over postgis or spatialite
databases and get the results:

- in a table view
- as a 'real time' layer displayed over the map canvas
- as a new table, that gets saved to the database and is immediately
loaded to the map canvas

It is still pretty raw, so I'm keeping it in the 'experimental'
section, but it seems to work OK with my small test datasets.


-- 
___ ___ __
Ricardo Garcia Silva
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


best.Re: [Qgis-developer] Spatialite ’select’ statement as vector layer in QGIS

2010-12-11 Thread Paolo Cavallini

Il 10/12/2010 16:17, Ricardo Filipe Soares Garcia da ha scritto:

Hi all
I've added a new version of this plugin (v 0.2).


Hi Ricardo.
Thanks for this. Could you please move it to the Database menu?
All the

--
http://www.faunalia.it/pc
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer