[Qgis-user] Placing group of image at once
Nigel Berjak - S3 Technologies
nigel at s3.co.za
Wed Aug 20 23:32:07 PDT 2025
Hi all
1) I wonder whether creating a bounding box (referenced in metres), as
each image being displayed should be the same size when viewed that then
uses the EXIF point coordinate to place the bounding box on the map
(portrait or landscape orientation should be able to be detected too)
and then places the image within this bounding box frame per image.
Doing it where you can only view a specific number of boxes based upon
the your location to the railway line would help to prevent loading
everything into memory. This would require you to write a script, I
suspect.
2) The other option would be to use the point coordinate and reference
the images as an image within the symbology/style, then using the sizing
property to ensure all images are the same dimensions and the EXIF
information to determine the orientation.
My first start would be to import the GeoTagged photos, or using the
XML, into a Geopackage, using an available plugin like Import Photos, to
generate the XY per point and image reference (you may want to try
embedding the image within the Geopackage, but I think this will make
the file unwieldy, then attempt to display the images as per (2) above.
Do you want the images permanently embedded in a raster for display? If
so, this does become cumbersome when you are wanting to update on
an-ongoing basis, whereas using the vectors in a geodatabase should
provide much more flexibility to update.
Finally, although I don't think it the projection approach is available
in QGIS, there is a 3D-piecewise georeferencing, which basically uses
the X, Y and Z to stretch your image vertically using the Z and orient
it using the X and Y. These naturally need to also be in
metres/centimetres. I used this for the vertical cross-sections for a
mine that I did some work for many years ago i.e. we used planar
georeferencing for the different 'ground' levels and then the
3D-piecewise georeferencing for the vertical cross-sections.
---
Regards,
Nigel Berjak
S3 Technologies
Geographic Information Systems & Large Format Printing specialists
T: +27 33 3423681
F: +27 86 6721242
E: nigel at S3.co.za
Website: http://www.S3.co.za
Please consider the environment before printing this email.
On 2025-08-21 00:04, Richard Duivenvoorde via QGIS-User wrote:
> Hi,
>
> Looks like a fun project.
>
> Can you provide the accompanying xml file for 'Try.jpg'?
>
> Because if you can create some script to convert that Try.xml to
> Try.wld (or whatever extension gdal/QGIS wants for a jpeg world file),
> you can maybe create a mosaic geotiff from it, though it will be
> HUGE...).
> Looking at: https://gdal.org/en/stable/drivers/raster/jpeg.html GDAL
> (the lib that loads rasters for QGIS, expects .jgw, .jpgw/.jpegw or
> .wld suffixes, not PGW ???)
>
> There is also a 'vrt' (GDAL Virtual Format) for all your jpg+wld files
> (https://gdal.org/en/latest/drivers/raster/vrt.html).
> Normally you will create a 'shapefile' then with the extents of all the
> images, which is then used as spatial index for gdal.
> Not sure if that can take into account rotation though.
> Hopefully somebody has some info about that.
>
> Last option could be, depending on the names of the xml and jpg files
> to do this loading 'on the fly' using some pyqgis... Like find all
> files in current extent and (by reading/interpreting the xml files)
> create the wld file on the fly and load every jpg+wld as layer...
>
> Also you do want to view all the raster/photo's as rasters, yes? Not as
> vector points with a popup showing the (rotated?) image?
>
> See what others come up with?
>
> It IS a lot of data to play with though :-)
>
> Regards,
>
> Richard Duivenvoorde
>
>
> On 20-08-2025 16:20, Léopold Stoessel via QGIS-User wrote:
>> Hello,
>>
>> Our team is currently working on a project to reconstruct the railways
>> of Canada using QGIS. To do this, we collect data directly on the
>> rails, taking a photo every 2 meters. Each image (JPG) is accompanied
>> by an XML file containing its GPS coordinates (EPSG:4326) and
>> orientation.
>>
>> Our goal is to display all the images on a QGIS map at their correct
>> geographic location and with the proper orientation. (Example image:
>> /Try.jpg/)
>>
>> As far as I understand, a JPG file needs either an associated PGW
>> world file or must be converted into a georeferenced TIFF in order to
>> be correctly placed on the map.
>>
>> Here are the challenges we're facing:
>>
>> * *PGW method*: I tried placing a PNG file with a PGW of the same
>> name in the same directory, but QGIS seems to ignore the PGW file and
>> creates HTML document with other coordinates instead.
>> * *GeoTIFF method*: With over 500,000 images, manually
>> georeferencing each one is not feasible.
>>
>> So I would like to ask for your advice:
>>
>> * Are we on the right track with our approach?
>> * Which method would you recommend in our case?
>> * Do you know of any way to automate the image placement and
>> orientation based on our XML data?
>> * Would it be possible to handle this through the Python console or
>> using PyQGIS?
>>
>> Any guidance or suggestions would be greatly appreciated.
>>
>> Thanks in advance for your time and help!
>>
>> **
>>
>> **
>>
>> ** <https://www.cefrail.ca/>**
>> <https://www.facebook.com/cefrail>**<https://www.linkedin.com/authwall?trk=bf&trkInfo=AQEjKKnHH0hB2QAAAYzqp8YogvhljVV4rfWfPZk4nt7Fxp7t-jgeC03T84SUqgFnFtN8YLHip3me96M7mf832Uiq6YnFyyw3y1AU8c10Tw4twclYPuLl6KexU9lj_p4Hp_UeifI=&original_referer=&sessionRedirect=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fcefrail>
>>
>>
>>
>> *Léopold Stoessel*
>>
>> Stagiaire - Génie ferroviaire
>>
>> 1 866 544-RAIL
>>
>> _leopold.stoessel at cegepsi.ca <mailto:leopold.stoessel at cegepsi.ca>_
>>
>> _www.cefrail.ca <http://www.cefrail.ca/> _
>>
>> /RAIL est un centre intégré au Cégep de Sept-Îles/
>>
>>
>>
>>
>> _______________________________________________
>> QGIS-User mailing list
>> QGIS-User at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
More information about the QGIS-User
mailing list