[Qgis-user] Placing group of image at once
Patrick Dunford
enzedrailmaps at gmail.com
Tue Sep 23 11:44:58 PDT 2025
JPEG rasters can need up to three additional files, including the .xml
and .aux.xml files. These files, among other things, hold the
specification of the CRS / projection to be used when displaying them.
The .aux.xml file is used for Persistent Auxiliary Metadata, which may
include a geotransform that is used instead of the world file (subject
to GDAL configuration, assuming Qgis uses the GDAL library functions).
More is certainly required than just a world file with each raster.
On 27/08/2025 00:10, Roland Spielhofer via QGIS-User wrote:
> Hi Leopold,
> as others mentioned, the sample image look like to be taken facing
> downward - like an aerial image take by a drone or veritcally from a
> railwagon - is this right?
> If you just want show the images on a map and have sort of a
> high-resolution aerial image of the tracks, you would just need to
> create a world file for each JPG.
> https://en.wikipedia.org/wiki/World_file
> You say you have a location and orientation for all images - this
> should be sufficient to create the world files.
> You would need the coordinate of the upper left corner of the image -
> probably the coordinate you have in your XML is the position of the
> camera that has taken the image. This would be the center of the image
> (assuming the camera looks vertical to the ground) Together with the
> heading (orientation) it would be easy to calculate the position of
> the upper left corner, given that the distance from camera to ground
> is known/fixed. If the camera was mounted on a railcar the distance is
> fixed and should be measured. If the distance between camera and
> ground varies with each image, it gets complicated because ... see below.
> If location accuracy is not that important you could also take the
> location from the XML file directly or apply a fixed offset.
> You then need the size of a pixel of the image on the ground
> (https://en.wikipedia.org/wiki/Ground_sample_distance)
> <https://en.wikipedia.org/wiki/Ground_sample_distance>- you could
> measure the distance between the rails in pixels on the image - the
> track gauge should be known or at least easy to find out (and assume
> that the pixel are square). Then you get the GSD and you can
> calculated the left upper corner location and start filling the world
> file with the other parameters.
> The rotation parmeters can then also be calculated from the
> orientation you have in the XML file.
> I would advise to use a rectangular (projected) coordinate system as
> all calculations are much easier in [m] than in [degrees].
> In any case the images will not match perfectly while they are
> distorted (which they are if they come directly from a camera). To
> avoid that, an elaborate process using a terrain model etc. would be
> necessaery - essentially the process to produce orthophotos.
> To handle the large amount of images there are is something like
> virtual rasters, IIRC.
> hth
> Roland
> *Gesendet: *Mittwoch, 20. August 2025 um 16:20
> *Von: *"Léopold Stoessel via QGIS-User" <qgis-user at lists.osgeo.org>
> *An: *"qgis-user at lists.osgeo.org" <qgis-user at lists.osgeo.org>
> *Betreff: *[Qgis-user] Placing group of image at once
>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250924/37e63106/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 780 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250924/37e63106/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 12263 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250924/37e63106/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 505 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250924/37e63106/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 5823 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250924/37e63106/attachment-0005.png>
More information about the QGIS-User
mailing list