[Qgis-developer] Loading PostGIS Raster data via "Add PostGIS Layer" menu option

Giuseppe Sucameli brush.tyler at gmail.com
Tue Jul 22 08:48:15 PDT 2014


Hi Jorge,

On Tue, Jul 22, 2014 at 4:57 PM, Jorge Arevalo <jorgearevalo at libregis.org>
wrote:

> I'm a developer of GDAL PostGIS Raster driver, and I'd like to know if it
> would be possible to modify the "Add PostGIS Layer" menu option to allow
> adding PostGIS Raster data, in addition to the PostGIS data.
>
>
I don't know how much effort could require to change that dialog to list PG
raster tables as well, but you may add a new option "Add PostGIS Raster
Layer" with a new dialog.

Opening the QgsPostgresProvider class definition [1], I see it inherits
> from QgsVectorDataProvider. I guess I could make the class also inherit
> from QgsRasterDataProvider, like GDAL does [2], but as I don't have any
> previous experience developing for QGIS core, I'm probably underestimating
> the difficulty (besides, I would also need GUI changes...).
>

You should develop a new provider which extends the QgsRasterDataProvider,
as the current one is for vectors only.

 I do have experience developing in C/C++, and developing for GDAL and
> PostGIS libraries. So, do you think this could be an affordable task,
> without changing a lot of existent code? I'd like this task to be my
> "August project"
>

It shouldn't be hard too much, but I'm quite sure you must create new
classes and not just change the existent ones.
Anyway, I hope someone who worked on raster stuff can give you any hints,
maybe it's easier than we can tell :)

Regards.


>
> Many thanks in advance.
>
> Best regards,
>  --
> Jorge Arevalo
>
> http://about.me/jorgeas80
>
> [1]
> https://github.com/qgis/QGIS/blob/master/src/providers/postgres/qgspostgresprovider.h
> [2]
> https://github.com/qgis/QGIS/blob/master/src/providers/gdal/qgsgdalprovider.h
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140722/27312f24/attachment.html>


More information about the Qgis-developer mailing list