It seems your main problem is:
How can I show photos on a map in QGIS?
You have the following at your disposal:
- A set of photos
- A lookup table with IPTC keywords and their corresponding coordinates (in the EPSG:25832 coordinate system)
This can be divided into the following sub-problems:
- Identify which keyword(s) a photo has
- If one of the keywords of the photo matches one in the lookup table:
- Lookup the coordinates that corresponds with that tag
- Reproject the EPSG:25832 coordinates to WGS84 (EPSG:4326) latitude and longitude coordinates
- Convert the lat/lon coordinates to a format suitable for the EXIF GPS tag
- Write the EXIF GPS tag of the photo
- Read in the photo into a QGIS map
The stackexchange network is not a coding service, so I cannot provide you with ready to go scripts, but I have suggestions on how to solve the sub-problems.
1. Identify which keyword(s) a photo has
- Using ExifTool, no need to install, it's a self-contained executable.
- Using a Python library such as:
2a. Lookup the coordinates that corresponds with that tag
This can be done in a myriad of ways, but I am familiar with Python where you can e.g. use a dictionary to store your lookup table:
lookup = {
'A4166': [546043.0552, 6189132.4628],
'A4165': [546031.2343, 6189128.3107],
etc...
}
Alternatively you could use a pandas DataFrame:
import pandas as pd
lookup = pd.read_csv('/path/to/file.csv')
coords = lookup.loc[lookup.ID == 'A4166']
2b. Reproject the EPSG:25832 coordinates to WSG84
Again, many ways, but in Python I would use geopandas to do any kind of reprojecting of coordinates. Assuming you would have used a Dataframe in the previous step:
import geopandas as gpd
gdf = gpd.GeoDataFrame(lookup, geometry=gpd.points_from_xy(lookup.X, lookup.Y)
# Let geopandas know that the data is in EPSG:25832
gdf.set_crs(epsg=25832)
# Reproject it to
gdf.to_crs(epsg=4326, inplace=True)
Now you have a lookup table in the variable gdf
with the coordinates in the WGS84 coordinate system.
2c. Convert the lat/lon coordinates to a format suitable for the EXIF GPS tag
The ExifTool documentation describes how the GPS tags look. You will have to create some conditions based on the coordinate sign on when to write N
or S
in the GPSLatitudeRef and E
or W
in the GPSLongitudeRef fields.
2d. Write the EXIF GPS tag of the photo
The same libraries from step 2a can be used to write to the appropriate fields.
3. Read in the photo into a QGIS map
This tutorial was the first hit on Google when I looked for "place photos in QGIS". Roughly the steps are:
- Import Geotagged Photos via Processing Toolbar > Vector Creation > Import Geotagged Photos
- View photos in popup: set the HTML Map Tip in the Display property of the layer to:
<img src="file:///[% photo %]" width="350" height="250">
If you run into any issues with solving one of the sub-problems you are very welcome to edit your question (or post a new one) showing what you've tried and where you get stuck.