<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html;">
<title>Scalix message content</title>
<style type="text/css">
<!--
.Normal {  text-align: left; text-indent:0pt; margin-top:0pt; margin-bottom:0pt; font-family: Arial; font-size: 12pt; }
.Default_Paragraph_Font {font-family: Arial; color: Black; background-color: white ; font-size: 12pt; font-weight: normal;  font-style: normal; font-variant: normal; vertical-align: normal; text-decoration: none;}
div.ltTOCtitle { font-family: Verdana; font-size: 8pt; font-weight: bold; text-align: center;}
div.ltTOCl1 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:32pt; text-indent:-32pt;}
div.ltTOCl2 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:40pt; text-indent:-32pt;}
div.ltTOCl3 {  font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:48pt; text-indent:-32pt;}
div.ltTOCl4 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:56pt; text-indent:-32pt;}
div.ltTOCl5 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:64pt; text-indent:-32pt;}
div.ltTOCl6 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:72pt; text-indent:-32pt;}
-->
</style>
</head>

<body>
<div class="Normal"><span style='font-size: 10pt; '>Hartmut</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>I made an update of the
plugin please try it. I can't test it because I don't have a Windows
box.</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Regards</span><br><span style='font-size: 10pt; '>Horst</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>------------------------------------------------</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Dr. Horst
Düster</span><br><span style='font-size: 10pt; '>Stv. Amtschef /
GIS-Koordinator </span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Kanton
Solothurn</span><br><span style='font-size: 10pt; '>Bau- und
Justizdepartement</span><br><span style='font-size: 10pt; '>Amt für
Geoinformation</span><br><span style='font-size: 10pt; '>SO!GIS
Koordination</span><br><span style='font-size: 10pt; '>Rötistrasse
4</span><br><span style='font-size: 10pt; '>CH-4501 Solothurn</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Telefon ++41(0)32 627 25
32</span><br><span style='font-size: 10pt; '>Telefax ++41(0)32 627 22
14</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>mailto:horst.duester@bd.so.ch</span><br><span style='font-size: 10pt; '>http://www.agi.so.ch</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>-----Ursprüngliche
Nachricht-----</span><br><span style='font-size: 10pt; '>Von: tschaun
[mailto:hartmut.tschauner@gmail.com]</span><br><span style='font-size: 10pt; '>Gesendet
am: Freitag, 13. März 2009
00:02</span><br><span style='font-size: 10pt; '>An:
qgis-user@lists.osgeo.org</span><br><span style='font-size: 10pt; '>Betreff: Re:
AW: Re: [Qgis-user] New PostGIS SQL Query Editor Plugin</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Horst,</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>I had been waiting for a
plugin such as yours for quite some time; all
the</span><br><span style='font-size: 10pt; '>analytical power of PostGIS
spatial SQL right on the desktop --
terrific.</span><br><span style='font-size: 10pt; '>Thanks for making this
functionality available. I have one problem to
report</span><br><span style='font-size: 10pt; '>and one
suggestion.</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>The problem: while your
plugin runs fine on Ubuntu, it crashes on my
Windows</span><br><span style='font-size: 10pt; '>system. The error message
is:</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>An error has occurred while
executing Python code:</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Traceback (most recent call
last):</span><br><span style='font-size: 10pt; '> 
File</span><br><span style='font-size: 10pt; '>"C:/Users/Hartmut/.qgis//python/plugins\postgisquery\PostgisQuery.py",
line</span><br><span style='font-size: 10pt; '>138, in
anzeigenVLayer</span><br><span style='font-size: 10pt; '>   
stderr=subprocess.PIPE</span><br><span style='font-size: 10pt; '>  File
"C:\OSGeo4W\apps\Python25\lib\subprocess.py", line 587, in
__init__</span><br><span style='font-size: 10pt; '>    errread, errwrite) =
self._get_handles(stdin, stdout,
stderr)</span><br><span style='font-size: 10pt; '>  File
"C:\OSGeo4W\apps\Python25\lib\subprocess.py", line 700,
in</span><br><span style='font-size: 10pt; '>_get_handles</span><br><span style='font-size: 10pt; '>
p2cread =
self._make_inheritable(p2cread)</span><br><span style='font-size: 10pt; '>  File
"C:\OSGeo4W\apps\Python25\lib\subprocess.py", line 745,
in</span><br><span style='font-size: 10pt; '>_make_inheritable</span><br><span style='font-size: 10pt; '>
DUPLICATE_SAME_ACCESS)</span><br><span style='font-size: 10pt; '>WindowsError:
[Error 6] The handle is invalid</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Python
version:</span><br><span style='font-size: 10pt; '>2.5.2 (r252:60911, Feb 21
2008, 13:11:45) [MSC v.1310 32 bit (Intel)]</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>The suggestion: I second the
suggestion made by a previous poster of using
a</span><br><span style='font-size: 10pt; '>view for data caching, or perhaps a
Sqlite/Spatialite database.
The</span><br><span style='font-size: 10pt; '>column-name limitations of
Shapefiles are extremely annoying, to say
the</span><br><span style='font-size: 10pt; '>least. They might even cause
serious problems when multiple column
names</span><br><span style='font-size: 10pt; '>receive identical abbreviations
(as they did in PgArc; please forgive me
if</span><br><span style='font-size: 10pt; '>your code takes care of this, I
haven't read it line by line).</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Thanks again for an
extremely welcome contribution. I anxiously await
a</span><br><span style='font-size: 10pt; '>fix/explanation of the Windows
problem.</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Regards,</span><br><span style='font-size: 10pt; '>Hartmut</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Düster Horst
wrote:</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>
John,</span><br><span style='font-size: 10pt; '>> 
</span><br><span style='font-size: 10pt; '>> I created the plugin due to the
lack of possibility to visualize
PostGIS</span><br><span style='font-size: 10pt; '>> SQL Queries with
resultant tables containing geometry columns.
In</span><br><span style='font-size: 10pt; '>> principle it should have a
similar behaviour like the PgAdmin3
SQL</span><br><span style='font-size: 10pt; '>> Editor. With the difference
that the new plugin creates a
geographical</span><br><span style='font-size: 10pt; '>> view at the result
too. </span><br><span style='font-size: 10pt; '>> 
</span><br><span style='font-size: 10pt; '>> Mini
docmentation:</span><br><span style='font-size: 10pt; '>> 1. You have to
define a PostGIS connection with the PostGIS
Connector</span><br><span style='font-size: 10pt; '>> 2. When you start the
plugin for the first time, it will ask for
a</span><br><span style='font-size: 10pt; '>> temp-path because it has to
store the resultant shape files into
a</span><br><span style='font-size: 10pt; '>> directory. For further sessions
this directory will be used until
you</span><br><span style='font-size: 10pt; '>> change it with the ...
button</span><br><span style='font-size: 10pt; '>> 3. select the former
defined PostGIS connectin</span><br><span style='font-size: 10pt; '>> 4.
Under the assumption you have a PostGIS Table called example with
one</span><br><span style='font-size: 10pt; '>> geometry-column you can use
the plugin to execute the following
query:</span><br><span style='font-size: 10pt; '>> 
</span><br><span style='font-size: 10pt; '>> select * from example
</span><br><span style='font-size: 10pt; '>> 
</span><br><span style='font-size: 10pt; '>> when you hit the execute button
or alternatively F5 the query is</span><br><span style='font-size: 10pt; '>>
executed and it produces a shape-file with the query result. But
my</span><br><span style='font-size: 10pt; '>> simple example doesn't make
much sense. The use of the plugin
makes</span><br><span style='font-size: 10pt; '>> sense when you develop
complex queries with joins, aggregations,
filter,</span><br><span style='font-size: 10pt; '>> functions etc. In this
case you are able to develop your query and
to</span><br><span style='font-size: 10pt; '>> view the result directly and
very easy. I think it is very
helpful.</span><br><span style='font-size: 10pt; '>> 
</span><br><span style='font-size: 10pt; '>>>Also, the plugin asks for a
temporary directory to store files in,
but</span><br><span style='font-size: 10pt; '>> it seems that you need a
permanent directory to work from. This is
where</span><br><span style='font-size: 10pt; '>> I am confused. Is this
meant to perform queries on >existing
postgis</span><br><span style='font-size: 10pt; '>> tables, or is it meant to
query a shapefile and then load it
into</span><br><span style='font-size: 10pt; '>> postgis? If the former, how
does it improve on adding a postgis
layer</span><br><span style='font-size: 10pt; '>> and performing the query
there? </span><br><span style='font-size: 10pt; '>> In many cases when you
develop spatial queries it is helpful to see
the</span><br><span style='font-size: 10pt; '>> result directly. Thus you
have to save the query-result temporarily
many</span><br><span style='font-size: 10pt; '>> times until you have
finished the development process. Than you can
take</span><br><span style='font-size: 10pt; '>> your query and make a view
from it into the database, which you can
load</span><br><span style='font-size: 10pt; '>> directly from PostGIS via
Postgres connector of course. The idea is
to</span><br><span style='font-size: 10pt; '>> have a developement tool it is
not the idea to create persistent</span><br><span style='font-size: 10pt; '>>
queries. If you like to save your temporary query result to a
non</span><br><span style='font-size: 10pt; '>> temporary place, please use
the QGIS save as shapefile
command.</span><br><span style='font-size: 10pt; '>> 
</span><br><span style='font-size: 10pt; '>> I hope that the intension and
the use of the plugin will be a
little</span><br><span style='font-size: 10pt; '>> more
precised.</span><br><span style='font-size: 10pt; '>> 
</span><br><span style='font-size: 10pt; '>>
Regrads</span><br><span style='font-size: 10pt; '>>
Horst</span><br><span style='font-size: 10pt; '>> 
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>
------------------------------------------------
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>> Dr. Horst Düster
</span><br><span style='font-size: 10pt; '>> Stv. Amtschef / GIS-Koordinator
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>> Kanton Solothurn
</span><br><span style='font-size: 10pt; '>> Bau- und Justizdepartement
</span><br><span style='font-size: 10pt; '>> Amt für Geoinformation
</span><br><span style='font-size: 10pt; '>> SO!GIS Koordination
</span><br><span style='font-size: 10pt; '>> Rötistrasse 4
</span><br><span style='font-size: 10pt; '>> CH-4501 Solothurn
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>> Telefon ++41(0)32 627 25 32
</span><br><span style='font-size: 10pt; '>> Telefax ++41(0)32 627 22 14
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>> mailto:horst.duester@bd.so.ch
</span><br><span style='font-size: 10pt; '>> http://www.agi.so.ch
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>> 
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>    -----Ursprüngliche
Nachricht-----</span><br><span style='font-size: 10pt; '>>    Von: John C.
Tull
[mailto:john.tull@wildnevada.org]</span><br><span style='font-size: 10pt; '>>
Gesendet am: Donnerstag, 12. März 2009
17:47</span><br><span style='font-size: 10pt; '>>    An: Düster
Horst</span><br><span style='font-size: 10pt; '>>    Cc:
qgis-user</span><br><span style='font-size: 10pt; '>>    Betreff: Re:
[Qgis-user] New PostGIS SQL Query Editor
Plugin</span><br><span style='font-size: 10pt; '>>   
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>    Düster,
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>    Do you have any documentation
on how to use this? I gave it a go
this</span><br><span style='font-size: 10pt; '>>    morning, but a simple
query statement did not work. What would be
a</span><br><span style='font-size: 10pt; '>>    snippet that would work in
the query editor given that one has
a</span><br><span style='font-size: 10pt; '>>    table called "example" in a
database called postgis with
public</span><br><span style='font-size: 10pt; '>>    schema on a local
server?</span><br><span style='font-size: 10pt; '>>   
</span><br><span style='font-size: 10pt; '>>   
</span><br><span style='font-size: 10pt; '>>    Also, the plugin asks for a
temporary directory to store files
in,</span><br><span style='font-size: 10pt; '>>    but it seems that you need
a permanent directory to work from.
This</span><br><span style='font-size: 10pt; '>>    is where I am confused.
Is this meant to perform queries on
existing</span><br><span style='font-size: 10pt; '>>    postgis tables, or is
it meant to query a shapefile and then load
it</span><br><span style='font-size: 10pt; '>>    into postgis? If the
former, how does it improve on adding a
postgis</span><br><span style='font-size: 10pt; '>>    layer and performing
the query there? </span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>   
Cheers,</span><br><span style='font-size: 10pt; '>>   
John</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>    On Mar 12, 2009, at 1:36 AM,
Düster Horst wrote:</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>      
</span><br><span style='font-size: 10pt; '>>       I just uploaded the new
PostGIS SQL Query Editor Plugin to
the</span><br><span style='font-size: 10pt; '>>       QGIS User-Contributed
Python Plugin Repository. The aim of
the</span><br><span style='font-size: 10pt; '>>       plugin is to edit and
perform any spatial PostGIS query from
an</span><br><span style='font-size: 10pt; '>>       editor environment.
After successful execution of a query
the</span><br><span style='font-size: 10pt; '>>       result will be loaded
from shape file to MapCanvas. The
plugin</span><br><span style='font-size: 10pt; '>>       works provided that
pgsql2shp is installed and the path
to</span><br><span style='font-size: 10pt; '>>       pgsql2shp is defined in
the system PATH environment.</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>       I hope that the plugin
will be helpful for you. I'm
looking</span><br><span style='font-size: 10pt; '>>       forward for any
comment.</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>      
Regards</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>       Dr. Horst
Düster</span><br><span style='font-size: 10pt; '>>       Stv. Amtschef /
GIS-Koordinator</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>       Kanton
Solothurn</span><br><span style='font-size: 10pt; '>>       Bau- und
Justizdepartement</span><br><span style='font-size: 10pt; '>>       Amt
für Geoinformation</span><br><span style='font-size: 10pt; '>>      
SO!GIS Koordination</span><br><span style='font-size: 10pt; '>>      
Rötistrasse 4</span><br><span style='font-size: 10pt; '>>       CH-4501
Solothurn</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>       Telefon ++41(0)32 627 25
32</span><br><span style='font-size: 10pt; '>>       Telefax ++41(0)32 627 22
14</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>      
mailto:horst.duester@bd.so.ch</span><br><span style='font-size: 10pt; '>>    
http://www.agi.so.ch</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>      
_______________________________________________</span><br><span style='font-size: 10pt; '>>
Qgis-user mailing list</span><br><span style='font-size: 10pt; '>>      
Qgis-user@lists.osgeo.org</span><br><span style='font-size: 10pt; '>>      
http://lists.osgeo.org/mailman/listinfo/qgis-user</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>   
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>>
_______________________________________________</span><br><span style='font-size: 10pt; '>>
Qgis-user mailing list</span><br><span style='font-size: 10pt; '>>
Qgis-user@lists.osgeo.org</span><br><span style='font-size: 10pt; '>>
http://lists.osgeo.org/mailman/listinfo/qgis-user</span><br><span style='font-size: 10pt; '>>
</span><br><span style='font-size: 10pt; '>> </span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>--
</span><br><span style='font-size: 10pt; '>View this message in context:
http://n2.nabble.com/AW%3A-Re%3A-New-PostGIS-SQL-Query-Editor-Plugin-tp2469837p2470673.html</span><br><span style='font-size: 10pt; '>Sent
from the qgis-user mailing list archive at Nabble.com.</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>_______________________________________________</span><br><span style='font-size: 10pt; '>Qgis-user
mailing
list</span><br><span style='font-size: 10pt; '>Qgis-user@lists.osgeo.org</span><br><span style='font-size: 10pt; '>http://lists.osgeo.org/mailman/listinfo/qgis-user</span></div>



</body>

</html>