<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I missed the pgsql2shp error when I ran this earlier (I had a path addition to make as that is in a non-standard location). Now I see your point for this, and it is a good idea. Thanks for the contribution and explanation. I'm sure I will be using it.<div><br></div><div>John</div><div><br><div><div>On Mar 12, 2009, at 1:25 PM, Düster Horst wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"> <div style="WORD-WRAP: break-word; webkit-nbsp-mode: space; webkit-line-break: after-white-space"> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">John,</font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2"></font></span>  </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">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. </font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2"></font></span>  </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">Mini docmentation:</font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">1. You have to define a PostGIS connection with the PostGIS Connector</font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">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</font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">3. select the former defined PostGIS connectin</font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">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:</font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2"></font></span>  </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">select * from example </font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2"></font></span>  </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">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.</font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2"></font></span>  </div> <div><span class="484240220-12032009">>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? </span> </div> <div><span class="484240220-12032009">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.</span> </div> <div><span class="484240220-12032009"></span>  </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">I hope that the intension and the use of the plugin will be a little more precised.</font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2"></font></span>  </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">Regrads</font></span> </div> <div><span class="484240220-12032009"><font face="Arial" color="#0000ff" size="2">Horst</font></span> </div> <div><font face="Arial" color="#0000ff" size="2"></font>  </div><p> <font face="Arial" color="#000000" size="2">------------------------------------------------</font> </p><p><font face="Arial" color="#000000" size="2">Dr. Horst Düster</font> <br> <font face="Arial" color="#000000" size="2">Stv. Amtschef / GIS-Koordinator </font> </p><p><font face="Arial" color="#000000" size="2">Kanton Solothurn</font> <br> <font face="Arial" color="#000000" size="2">Bau- und Justizdepartement</font> <br> <font face="Arial" color="#000000" size="2">Amt für Geoinformation</font> <br> <font face="Arial" color="#000000" size="2">SO!GIS Koordination</font> <br> <font face="Arial" color="#000000" size="2">Rötistrasse 4</font> <br> <font face="Arial" color="#000000" size="2">CH-4501 Solothurn</font> </p><p><font face="Arial" color="#000000" size="2">Telefon ++41(0)32 627 25 32</font> <br> <font face="Arial" color="#000000" size="2">Telefax ++41(0)32 627 22 14</font> </p><p><font face="Arial" color="#000000" size="2"><a target="_blank" href="mailto:horst.duester@bd.so.ch">mailto:horst.duester@bd.so.ch</a></font> <br> <font face="Arial" color="#000000" size="2"><a target="_blank" href="http://www.agi.so.ch/">http://www.agi.so.ch</a></font> </p> <div><font face="Arial" color="#0000ff" size="2"></font>  </div> <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">   <div><font face="Times New Roman" size="2">-----Ursprüngliche   Nachricht-----<br> <b>Von:</b> John C. Tull   [<a href="mailto:john.tull@wildnevada.org">mailto:john.tull@wildnevada.org</a>]<br> <b>Gesendet am:</b> Donnerstag, 12. März   2009 17:47<br> <b>An:</b> Düster Horst<br> <b>Cc:</b>   qgis-user<br> <b>Betreff:</b> Re: [Qgis-user] New PostGIS SQL Query Editor   Plugin<br> </font></div><font face="Times New Roman" size="2"></font><p> Düster,  </p><div><br> </div>  <div>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? </div>  <div><font face="Arial" color="#0000ff" size="2"></font><br> </div>  <div>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?  </div>  <div><br> </div>  <div>Cheers, </div>  <div>John </div>  <div><br>   <div>  <div>On Mar 12, 2009, at 1:36 AM, Düster Horst wrote: </div><br class="Apple-interchange-newline">   <blockquote type="cite"> <span class="Apple-style-span" style="WORD-SPACING: 0px; FONT: 14px Arial; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">    <div>    <div class="Normal" style="MARGIN-TOP: 0pt; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; TEXT-INDENT: 0pt; FONT-FAMILY: Arial; TEXT-ALIGN: left"><span style="FONT-SIZE: 10pt">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.</span> </div><br>     <div class="Normal" style="MARGIN-TOP: 0pt; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; TEXT-INDENT: 0pt; FONT-FAMILY: Arial; TEXT-ALIGN: left"><span style="FONT-SIZE: 10pt">I hope that the plugin will be helpful for you. I'm     looking forward for any comment.</span> </div><br>     <div class="Normal" style="MARGIN-TOP: 0pt; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; TEXT-INDENT: 0pt; FONT-FAMILY: Arial; TEXT-ALIGN: left"><span style="FONT-SIZE: 10pt">Regards</span> </div><br>     <div class="Normal" style="MARGIN-TOP: 0pt; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; TEXT-INDENT: 0pt; FONT-FAMILY: Arial; TEXT-ALIGN: left"><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" style="MARGIN-TOP: 0pt; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; TEXT-INDENT: 0pt; FONT-FAMILY: Arial; TEXT-ALIGN: left"><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" style="MARGIN-TOP: 0pt; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; TEXT-INDENT: 0pt; FONT-FAMILY: Arial; TEXT-ALIGN: left"><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" style="MARGIN-TOP: 0pt; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; TEXT-INDENT: 0pt; FONT-FAMILY: Arial; TEXT-ALIGN: left"><span style="FONT-SIZE: 10pt"><a href="mailto:horst.duester@bd.so.ch">mailto:horst.duester@bd.so.ch</a></span><br> <span style="FONT-SIZE: 10pt"><a href="http://www.agi.so.ch">http://www.agi.so.ch</a></span> </div><br> _______________________________________________<br> Qgis-user     mailing list<br> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br> </div></span></blockquote> </div><br> </div><div> <br class="webkit-block-placeholder"></div></blockquote></div></blockquote></div><br></div></body></html>