[Qgis-developer] QgsMapCanvas with Dimap data

Tim Sutton lists at linfiniti.com
Tue Jan 25 23:38:37 EST 2011

Hi John

On Mon, Jan 24, 2011 at 6:01 PM, John de Muller
<john.de.muller at gmail.com> wrote:
> Good day
> I currently have some QgsRasterLayers without any metadata stored in the
> image file itself. All the metadata (eg: coordinates, rows, columns, crs,
> etc) is stored in an external Dimap (.dim) file. How can a pass these
> coordinates (like the top-left corner of the layer) to QgsRasterLayer or
> QgsMapCanvas so that the work with the real coordinates and not the pixel
> values.
> For instance: When I currently load the image, the coordinates QGIS uses is
> the width and height (in pixels) of the image (eg: 800*600). I want to
> adjust these values so that they represent real world coordinates (with the
> metadata from the dim file).
> I've found the the QgsRasterViewPort, but it seems like it is not possible
> to set these values through QgsRasterLayer. Any kind of help would be
> appreciated.

I guess most people would use gdalwarp or similar to assign this info
directly to the image. On the premise that you don't wish to do that,
I suspect that the upcoming merge of the raster projection branch may
be useful to you since it includes support to create new raster
provider types. In the provider definition you should be able to deal
with parsing the dimap file and registering the image internally. Note
I havent tested this so perhaps Radim can comment more usefully.



> Thank you.
> John
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net

More information about the Qgis-developer mailing list