# Scaling a soil profile Raster to georeference and vectorize Raster data

I have pictures of root patterns, where each root is marked by a point. We worked on soil profile walls, so there is no coordinate system to use as a basemap. I loaded it to QGIS and classified it into black and white pixels (black = Rootpoint). Now I would like to scale the raster, so I can refer to the area I collected the data. In reality the area is 75cm long and 100 cm high.So I want the coordinates of the corners to be (0|0), (0|75), (-100|0) and (-100|75). How do I do that?

Further I want to verctorize, and assign coordinates to each point. My goal is, to have a Table whith each root listed with it's coodinates. Further, I want to calculate Voronoi polygones (therefor I like to vectorize the points). Also some frequency calculations are planned, to see, how many roots are in the first 10 cm and so on...

These are my ideas, is it even possible with QGis? Or is it something for R?

• I think this is something which should be done in CAD or a drawing program. Why do you feel the need to do this in QGIS?
– Erik
Commented Sep 8, 2021 at 7:49
• Welcome to GIS SE. To me, the question is unclear: what kind of data do you load (raster), how did you collect it? Can you share the data to better understand what you have? Don't you have a GPS information from when you collected the data? How did you do georeferencing? If you load a basemap (otherwise, not georeferencing is possible), you have the CRS of the basemap. You final goal is unclear as well. So you should edit your initial question and add these information there. Commented Sep 8, 2021 at 8:02
• So this is actually a vertical section, not a horizontal map? Commented Sep 8, 2021 at 8:22
• yes its vertical. So I want the coordinates of the corners to be (0I0), (0I75), (-100I0) and (-100I75). Commented Sep 8, 2021 at 8:25
• This information is crucial and should be included in the question! Commented Sep 8, 2021 at 8:29

1. Assigning a (fake) Reference System

Since this data are not a "real" projection, you can use any `CRS` (Coordinate Reference System) you want. I would suggest to assign any UTM, but it really does not make any difference. Doble click on the raster name in the Browser panel, and click on the `Source` tab, then select the desired `CRS`:

2. Georeferencing

From the `Raster` menu, select `Georeferencer`, select the imported raster, and load the following points (you will need to save these as a text file named for example `roots.points`):

``````#CRS:
mapX,mapY,pixelX,pixelY,enable,dX,dY,residual
0,0,0,0,1,0,0,0
0,100,0,-5904,1,0,0,0
75,0,4540,0,1,0,0,0
75,100,4540,-5904,1,0,0,0
``````

you should now obtain something like this:

i.e. where you "map" the pixels on the image file to UTM coordinates.

From `Settings` select the Transofmration parameters as follows:

hit `File`->`Start Georeferencing`

and you should see the georeferenced layer appear in the Browser panel.

Educational ;) Notes

• the 4540 and 5904 values in the `points` file are derived from the pixel dimensions of the image file, so for other images, these shall be checked/changed
• since we did a linear transformation, you might have noticed that there is new raster file was created, only a so called "world file". This is a text file which tells QGIS to start drawing the raster from a given coordinate, in this case (0;0), and assign each pixels a given width and height.
• I'm still not sure if I understood the question correctly... What I understood is that the raster is something like: netexplanations.com/wp-content/uploads/2021/04/Soil-Profile.jpg - thus we do not have X/Y coordinates, but rather something like X/Z coordinates. With your solution, don't we just lay the raster over a basemap (horzizontally), where it should rather be positioned vertically? Commented Sep 8, 2021 at 8:52
• Agreed: this solution maps the data on a X/Y plane, where the data is originally X/Z. Of course this makes only sense if the dataset are analysed individually, not as "transects" on an actual map. From the OP, however, I think this would be what they need at the moment. Also, this will make it possible to vectorize the data in QGIS; ouptut points should/could be transposed to X/Y/Z (probably with a fixed Y or linear X/Y combo for each file) at the end. Commented Sep 8, 2021 at 9:00
• @RafDouglas Thank you so much! I knew the solution must be pretty easy .. Commented Sep 8, 2021 at 9:25