AW: Re: AW: Re: [Qgis-user] New PostGIS SQL Query Editor Plugin

Düster Horst Horst.Duester at bd.so.ch
Fri Mar 13 08:22:10 PDT 2009


Hartmut

I made an update of the plugin please try it. I can't test it because I
don't have a Windows box.

Regards
Horst

------------------------------------------------

Dr. Horst Düster
Stv. Amtschef / GIS-Koordinator 

Kanton Solothurn
Bau- und Justizdepartement
Amt für Geoinformation
SO!GIS Koordination
Rötistrasse 4
CH-4501 Solothurn

Telefon ++41(0)32 627 25 32
Telefax ++41(0)32 627 22 14

mailto:horst.duester at bd.so.ch
http://www.agi.so.ch



-----Ursprüngliche Nachricht-----
Von: tschaun [mailto:hartmut.tschauner at gmail.com]
Gesendet am: Freitag, 13. März 2009 00:02
An: qgis-user at lists.osgeo.org
Betreff: Re: AW: Re: [Qgis-user] New PostGIS SQL Query Editor Plugin


Horst,

I had been waiting for a plugin such as yours for quite some time; all
the
analytical power of PostGIS spatial SQL right on the desktop --
terrific.
Thanks for making this functionality available. I have one problem to
report
and one suggestion.

The problem: while your plugin runs fine on Ubuntu, it crashes on my
Windows
system. The error message is:

An error has occurred while executing Python code:

Traceback (most recent call last):
  File
"C:/Users/Hartmut/.qgis//python/plugins\postgisquery\PostgisQuery.py",
line
138, in anzeigenVLayer
    stderr=subprocess.PIPE
  File "C:\OSGeo4W\apps\Python25\lib\subprocess.py", line 587, in
__init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File "C:\OSGeo4W\apps\Python25\lib\subprocess.py", line 700, in
_get_handles
    p2cread = self._make_inheritable(p2cread)
  File "C:\OSGeo4W\apps\Python25\lib\subprocess.py", line 745, in
_make_inheritable
    DUPLICATE_SAME_ACCESS)
WindowsError: [Error 6] The handle is invalid

Python version:
2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

The suggestion: I second the suggestion made by a previous poster of
using a
view for data caching, or perhaps a Sqlite/Spatialite database. The
column-name limitations of Shapefiles are extremely annoying, to say the
least. They might even cause serious problems when multiple column names
receive identical abbreviations (as they did in PgArc; please forgive me
if
your code takes care of this, I haven't read it line by line).

Thanks again for an extremely welcome contribution. I anxiously await a
fix/explanation of the Windows problem.

Regards,
Hartmut



Düster Horst wrote:
> 
> John,
>  
> I created the plugin due to the lack of possibility to visualize
PostGIS
> SQL Queries with resultant tables containing geometry columns. In
> principle it should have a similar behaviour like the PgAdmin3 SQL
> Editor. With the difference that the new plugin creates a geographical
> view at the result too. 
>  
> Mini docmentation:
> 1. You have to define a PostGIS connection with the PostGIS Connector
> 2. When you start the plugin for the first time, it will ask for a
> temp-path because it has to store the resultant shape files into a
> directory. For further sessions this directory will be used until you
> change it with the ... button
> 3. select the former defined PostGIS connectin
> 4. Under the assumption you have a PostGIS Table called example with
one
> geometry-column you can use the plugin to execute the following query:
>  
> select * from example 
>  
> when you hit the execute button or alternatively F5 the query is
> executed and it produces a shape-file with the query result. But my
> simple example doesn't make much sense. The use of the plugin makes
> sense when you develop complex queries with joins, aggregations,
filter,
> functions etc. In this case you are able to develop your query and to
> view the result directly and very easy. I think it is very helpful.
>  
>>Also, the plugin asks for a temporary directory to store files in, but
> it seems that you need a permanent directory to work from. This is
where
> I am confused. Is this meant to perform queries on >existing postgis
> tables, or is it meant to query a shapefile and then load it into
> postgis? If the former, how does it improve on adding a postgis layer
> and performing the query there? 
> In many cases when you develop spatial queries it is helpful to see
the
> result directly. Thus you have to save the query-result temporarily
many
> times until you have finished the development process. Than you can
take
> your query and make a view from it into the database, which you can
load
> directly from PostGIS via Postgres connector of course. The idea is to
> have a developement tool it is not the idea to create persistent
> queries. If you like to save your temporary query result to a non
> temporary place, please use the QGIS save as shapefile command.
>  
> I hope that the intension and the use of the plugin will be a little
> more precised.
>  
> Regrads
> Horst
>  
> 
> ------------------------------------------------ 
> 
> Dr. Horst Düster 
> Stv. Amtschef / GIS-Koordinator 
> 
> Kanton Solothurn 
> Bau- und Justizdepartement 
> Amt für Geoinformation 
> SO!GIS Koordination 
> Rötistrasse 4 
> CH-4501 Solothurn 
> 
> Telefon ++41(0)32 627 25 32 
> Telefax ++41(0)32 627 22 14 
> 
> mailto:horst.duester at bd.so.ch 
> http://www.agi.so.ch 
> 
>  
> 
>    -----Ursprüngliche Nachricht-----
>    Von: John C. Tull [mailto:john.tull at wildnevada.org]
>    Gesendet am: Donnerstag, 12. März 2009 17:47
>    An: Düster Horst
>    Cc: qgis-user
>    Betreff: Re: [Qgis-user] New PostGIS SQL Query Editor Plugin
>    
> 
>    Düster, 
> 
>    Do you have any documentation on how to use this? I gave it a go
this
>    morning, but a simple query statement did not work. What would be a
>    snippet that would work in the query editor given that one has a
>    table called "example" in a database called postgis with public
>    schema on a local server?
>    
>    
>    Also, the plugin asks for a temporary directory to store files in,
>    but it seems that you need a permanent directory to work from. This
>    is where I am confused. Is this meant to perform queries on
existing
>    postgis tables, or is it meant to query a shapefile and then load
it
>    into postgis? If the former, how does it improve on adding a
postgis
>    layer and performing the query there? 
> 
>    Cheers,
>    John
> 
>    On Mar 12, 2009, at 1:36 AM, Düster Horst wrote:
> 
> 
>       
>       I just uploaded the new PostGIS SQL Query Editor Plugin to the
>       QGIS User-Contributed Python Plugin Repository. The aim of the
>       plugin is to edit and perform any spatial PostGIS query from an
>       editor environment. After successful execution of a query the
>       result will be loaded from shape file to MapCanvas. The plugin
>       works provided that pgsql2shp is installed and the path to
>       pgsql2shp is defined in the system PATH environment.
> 
>       I hope that the plugin will be helpful for you. I'm looking
>       forward for any comment.
> 
>       Regards
> 
>       Dr. Horst Düster
>       Stv. Amtschef / GIS-Koordinator
> 
>       Kanton Solothurn
>       Bau- und Justizdepartement
>       Amt für Geoinformation
>       SO!GIS Koordination
>       Rötistrasse 4
>       CH-4501 Solothurn
> 
>       Telefon ++41(0)32 627 25 32
>       Telefax ++41(0)32 627 22 14
> 
>       mailto:horst.duester at bd.so.ch
>       http://www.agi.so.ch
> 
>       _______________________________________________
>       Qgis-user mailing list
>       Qgis-user at lists.osgeo.org
>       http://lists.osgeo.org/mailman/listinfo/qgis-user
>       
> 
> 
>    
> 
> 
> 
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
> 
> 

-- 
View this message in context:
http://n2.nabble.com/AW%3A-Re%3A-New-PostGIS-SQL-Query-Editor-Plugin-tp2
469837p2470673.html
Sent from the qgis-user mailing list archive at Nabble.com.

_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20090313/98d64eec/attachment.html>


More information about the Qgis-user mailing list