I have photoindex, each tile is a georeferenced jpg and I have a list of coordinates that can be represented as point.
If a point is contained in a tile, I must put a symbol in that tile where the point is to save the tile as jpg using the id of the point as the filename.
Is there an easy way to do this with a lot of points (thousands)?
I know some Python.
Edit: So I have found a way to do it. I'm pretty sure I can still improve some steps but it works.
- Make a tile index from the rasters with QGIS tool Tile Index
- Convert coordinates to points
- Add polygon attributes (From the tile index layer we are gonna take the attribute "name", that is the name of the raster) to points (the coordinates)
- Now some python. Iterate through all points
- With the new database from the result of step 3. From the newly added column take the name of the raster and open it with rasterio.open() function
- Then use rasterio method ".index()" this will take the coordinates to convert them to pixel coordinates (the raster projection and the given coordinates must be on the same projection)
- Use PIL to draw a circle on the image in the given pixel coordinates
Later I'll put the code