<span dir="ltr"></span>Ok, now that i got my hands on my ubuntugis packages... Well some odd stuff.<br>Hum... the "mode=" was added on the new driver? On 1.7 I couldn't make it work with it.<br>I fixed andreas' sugestions and found a new bug. When I read from the table I should read both schema and tablename from that. And at the moment the plugin is not doing it. This could solve the "schema" problem. I'm going to fix this and release a new version.<br>
I don't really know if I'm going to let the mode turned on. Only if I can get it to work with ubuntugis' gdal version.<br>Mauricio de Paulo<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Thu, Dec 2, 2010 at 9:00 AM, Jorge Arévalo <span dir="ltr"><<a href="mailto:jorge.arevalo@deimos-space.com" target="_blank">jorge.arevalo@deimos-space.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div>On Thu, Dec 2, 2010 at 9:29 AM, Andreas Neumann <<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>> wrote:<br>
> Hi Jorge and Mauricio,<br>
><br>
> Thank you for both of your help/feedback.<br>
><br>
> As far as I can tell, there are two problems with the QGIS wktraster<br>
> plugin. It is currently not generating the correct connection string.<br>
> Mauricio - could you please check?<br>
><br>
> 1. schema name is not picked up correctly from the table<br>
><br>
> 2. reading mode is not correctly specified. My data set is tiled (read in<br>
> with the "k" parameter). I select "Read tiled raster in a table" and the<br>
> plugin selects mode "1" - but it should select mode "2", according to<br>
> Jorge and <a href="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html" target="_blank">http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html</a>.<br>
><br>
> It seems like Mauricios plugin uses a zero-based list for the mode, while<br>
> it should use a one-based list.<br>
><br>
> The second problem is very easy to fix by changing the line<br>
><br>
> mode=self.dlg.ui.comboBox_2.currentIndex()<br>
> to<br>
> mode=self.dlg.ui.comboBox_2.currentIndex()+1<br>
><br>
> and then<br>
> if (mode!=2):<br>
> to<br>
> if (mode!=3):<br>
><br>
> The first problem is little harder to fix.<br>
><br>
> Anyway - once I fixed the issue, the raster loads fine, but it is very,<br>
> very, very slow - too slow for real work.<br>
><br>
> I have to admit, I did not create pyramids. Would the wktraster plugin and<br>
> the underlying driver support the pyramids? My test raster file is<br>
> 3600x4000 pixels - so it isn't really large.<br>
><br>
> Any experiences with the pyramids with wktraster?<br>
><br>
> Thanks a lot so far!<br>
><br>
> Andreas<br>
><br>
<br>
</div></div>Hi Andreas, Mauricio<br>
<br>
Yes, it's possible to create pyramids with the PostGIS Raster loader,<br>
using the "-l" and "-V" options as follows:<br>
<br>
- "-l N", where N is the overview level. This option force GDAL to<br>
build overviews of the original raster, and store them as new raster<br>
tables with the name "o_<LEVEL>_<RASTER_TABLE>". <RASTER_TABLE> is the<br>
name you provide with the "-t" option. You should execute the loader<br>
one time for each pyramid level desired (-l 2, -l 4, -l 8, and so on).<br>
<br>
- "-V" forces the creation of the RASTER_OVERVIEWS table. This table<br>
stores the names of all the overviews of all the raster tables (the<br>
overviews are different tables, remember it). You should only provide<br>
this option the first time you execute the loader script. But provide<br>
it at least one time, because the GDAL driver needs this table to know<br>
if each raster table has overviews or not.<br>
<br>
Further information on raster loader here:<br>
<a href="http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationFinal01" target="_blank">http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationFinal01</a><br>
<br>
You probably may want to test the plugin with raster overviews. I'm<br>
going to test it ASAP. Anyway, the driver performance is an important<br>
TODO task.<br>
<font color="#888888"><br>
<br>
--<br>
</font><div><div></div><div>Jorge Arévalo<br>
Internet & Mobilty Division, DEIMOS<br>
<a href="mailto:jorge.arevalo@deimos-space.com" target="_blank">jorge.arevalo@deimos-space.com</a><br>
<a href="http://mobility.grupodeimos.com/" target="_blank">http://mobility.grupodeimos.com/</a><br>
<a href="http://gis4free.wordpress.com" target="_blank">http://gis4free.wordpress.com</a><br>
<br>
> On Wed, December 1, 2010 10:25 pm, Jorge Arévalo wrote:<br>
>> 2010/12/1 Maurício de Paulo <<a href="mailto:mauricio.dev@gmail.com" target="_blank">mauricio.dev@gmail.com</a>>:<br>
>>> Thanks jorge!<br>
>>> Then I figure it's a bug in the plugin. I wrote the wrong modes. I'm<br>
>>> fixing<br>
>>> and updating.<br>
>>> Hum... I'm going to wait for your responde on the parsing part. If not,<br>
>>> should I parse it on the plugin?<br>
>>> Best regards,<br>
>>> Mauricio de Paulo<br>
>>><br>
>><br>
>> Hi Mauricio,<br>
>><br>
>> Just check it. If you don't provide schema name, 'public' is<br>
>> automatically selected. So, if you specify 'dtm.dtmav' as table name,<br>
>> and don't provide a 'schema' option, the driver tries to connect with<br>
>> 'public.dtm.dtmav', what is wrong.<br>
>><br>
>> I suppose I could allow the "table=schema.table_name" syntax, but I'd<br>
>> like to keep the 'schema=' keyword to keep the schema browsing<br>
>> capability.<br>
>><br>
>> So, it's not a plugin error. I don't think you need to change it. By<br>
>> now, just use the 'schema' keyword to specify a schema name. About the<br>
>> mode, remember that:<br>
>><br>
>> - 'mode=1' means each row is a different raster. Report all rows as<br>
>> subdatasets<br>
>> - 'mode=2' means all rows are tiles of a bigger raster. The driver<br>
>> will 'construct' a whole raster coverage based on all tiles' extent<br>
>><br>
>> The default mode is 'mode=1'. If you stored a tiled raster (providing<br>
>> -k option to gdal2wkraster/raster2pgsql script) and you want the<br>
>> entire raster again, provide 'mode=2' in connection string. Otherwise,<br>
>> each row will be treated as a single raster file.<br>
>><br>
>> About PostgreSQL 9.0, I didn't test it yet, but AFAIK, it should work<br>
>> in the same way that works with PostgreSQL 8.4, for example.<br>
>><br>
>> I'm really interested in this work. Thanks for testing the driver :-)<br>
>><br>
>>> 2010/12/1 Jorge Arévalo <<a href="mailto:jorge.arevalo@deimos-space.com" target="_blank">jorge.arevalo@deimos-space.com</a>><br>
>>>><br>
>>>> Hello,<br>
>>>><br>
>>>> On Wed, Dec 1, 2010 at 7:19 PM, Maurício de Paulo<br>
>>>> <<a href="mailto:mauricio.dev@gmail.com" target="_blank">mauricio.dev@gmail.com</a>> wrote:<br>
>>>> > Hi Andreas,<br>
>>>> > As you were able to load the raster metadata i'm assuming you<br>
>>>> installed<br>
>>>> > the<br>
>>>> > wktraster sql on the database.<br>
>>>> > I've never tested myself on postgresql 9.0.<br>
>>>> > Do you have a postgresql 8.4 instance to test too? Just to be sure if<br>
>>>> > it's a<br>
>>>> > gdal incompatibility with 9.0.<br>
>>>> > Thanks for the information, I'm repassing to Jorge (GDAL's<br>
>>>> developper).<br>
>>>> > Best regards,<br>
>>>> > Mauricio de Paulo<br>
>>>> ><br>
>>>> >> Hi,<br>
>>>> >><br>
>>>> >> I am trying to get the wktraster plugin to work.<br>
>>>> >><br>
>>>> >> The initial connection to the db is fine. It lists all my raster<br>
>>>> >> datasets<br>
>>>> >> I have in the db.<br>
>>>> >><br>
>>>> >> After selecting a raster (and adding the schema-name in front of the<br>
>>>> >> table-name) I hit ok and after entering the password again, I get<br>
>>>> the<br>
>>>> >> following error message:<br>
>>>> >><br>
>>>> >> Could not load PG: dbname=uster host=localhost user=an password=xxx<br>
>>>> >> port=5432 table=dtm.dtmav mode=1<br>
>>>> >><br>
>>>> >> In the console that started QGIS I get a warning:<br>
>>>> >><br>
>>>> >> Warning: This version of PostgreSQL is not supported and may not<br>
>>>> work.<br>
>>>> >> ERROR 1: Error browsing database for PostGIS Raster properties<br>
>>>> >><br>
>>>> >> Here is my Postgres/Postgis version string:<br>
>>>> >><br>
>>>> >> "PostgreSQL 9.0.1 on x86_64-unknown-linux-gnu, compiled by GCC gcc<br>
>>>> >> (Ubuntu<br>
>>>> >> 4.4.3-4ubuntu5) 4.4.3, 64-bit"<br>
>>>> >><br>
>>>> >> "POSTGIS="1.5.2" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23<br>
>>>> September<br>
>>>> >> 2009" LIBXML="2.7.6" USE_STATS"<br>
>>>> >><br>
>>>> >> Do you have any idea what may be wrong here? Is PostgreSQL 9.0 not<br>
>>>> >> supported? It works fine with my other QGIS projects ...<br>
>>>> >><br>
>>>> >> Thanks,<br>
>>>> >> Andreas<br>
>>>> >><br>
>>>> >> --<br>
>>>> >> Andreas Neumann<br>
>>>> >> <a href="http://www.carto.net/neumann/" target="_blank">http://www.carto.net/neumann/</a><br>
>>>> >> <a href="http://www.svgopen.org/" target="_blank">http://www.svgopen.org/</a><br>
>>>> >><br>
>>>> ><br>
>>>> ><br>
>>>> > --<br>
>>>> > Mauricio de Paulo<br>
>>>> > Engenheiro Cartografo<br>
>>>> ><br>
>>>> ><br>
>>>><br>
>>>> I assume you're using the new version of GDAL driver, commited on<br>
>>>> release 20912 (<a href="http://trac.osgeo.org/gdal/changeset/20912" target="_blank">http://trac.osgeo.org/gdal/changeset/20912</a>). The right<br>
>>>> syntax for the connection string should be<br>
>>>><br>
>>>> PG:"dbname=uster host=localhost user=an password=xxx port=5432<br>
>>>> schema=dtm table=dtmav mode=1"<br>
>>>><br>
>>>> instead of<br>
>>>><br>
>>>> PG: dbname=uster host=localhost user=an password=xxx port=5432<br>
>>>> table=dtm.dtmav mode=1<br>
>>>><br>
>>>> With this string, you'll read the rows of the table dtmav, schema dtm,<br>
>>>> as different raster files. So, the driver will report these rows as<br>
>>>> subdatasets. If you use mode=2, all the rows are considered as tiles<br>
>>>> of a bigger raster coverage.<br>
>>>><br>
>>>> Anyway, let me check if the driver parses the<br>
>>>> "table=<schema>.<table_name>" syntax. I can't remember it.<br>
>>>><br>
>>>> --<br>
>>>> Jorge Arévalo<br>
>>>> Internet & Mobilty Division, DEIMOS<br>
>>>> <a href="mailto:jorge.arevalo@deimos-space.com" target="_blank">jorge.arevalo@deimos-space.com</a><br>
>>>> <a href="http://mobility.grupodeimos.com/" target="_blank">http://mobility.grupodeimos.com/</a><br>
>>>> <a href="http://gis4free.wordpress.com" target="_blank">http://gis4free.wordpress.com</a><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Mauricio de Paulo<br>
>>> Engenheiro Cartografo<br>
>>><br>
>>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Jorge Arévalo<br>
>> Internet & Mobilty Division, DEIMOS<br>
>> <a href="mailto:jorge.arevalo@deimos-space.com" target="_blank">jorge.arevalo@deimos-space.com</a><br>
>> <a href="http://mobility.grupodeimos.com/" target="_blank">http://mobility.grupodeimos.com/</a><br>
>> <a href="http://gis4free.wordpress.com" target="_blank">http://gis4free.wordpress.com</a><br>
>><br>
><br>
><br>
> --<br>
> Andreas Neumann<br>
> <a href="http://www.carto.net/neumann/" target="_blank">http://www.carto.net/neumann/</a><br>
> <a href="http://www.svgopen.org/" target="_blank">http://www.svgopen.org/</a><br>
><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br><div><div></div><div class="h5">Mauricio de Paulo<br>Engenheiro Cartografo<br><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mauricio de Paulo<br>Engenheiro Cartografo<br><br>