3

The following figure shows my QGIS-3.16-Canvas with an excerpt of a TrueOrtophoto (tif), with a 10-meters-point-grid in front corresponding to the pixel size of my satellite imagery. (The Ortophotos CRS is EPSG:8687 - Slovenia 1996 / UTM zone 33N, Layer-projection is EPSG:32633 - WGS 84 / UTM zone 33N)

enter image description here

Now, I want to re-georeference the the whole TrueDOP of about 1 sqare kilometer (not only the excerpt) by about 20 meters towards west and 10 meters towards north (see red arrows).

I recently had a similar question (QGIS: Shifting ortophotos by some meters to equalize the mismatch/offset/incongruence with satellite imagery), in which Tisham Dhar suggested to work with this GDAL Georeferencer tool.
I had a look at it, and if I understood this tool right: There, I load the Raster-image separately (not using it by refering to QGis-Layers). You set your source and destination Ground Control Points (GCP) in the Georeferencer-tool-canvas and run the georeferencing.

But, what I'm looking for is a solution where I can

  • use the raster-image out of my layers and as they are projected there,
  • use my raster points including the snapping options in order to define my GCPs.
  • ideally - as I have a lot of TrueDOPs - proceed multiple layers/images at once.

That means, the tool should either work directly in the QGIS-Canvas, or may have its own canvas, but with using my QGIS-layers (with snapping functionality) as source, or ...(?)

In the end it would enough or even better not to re-georeference the image itself, but just modifying the layer / layer-CRS in order to display the images these few meters more west/north.

At the beginning I thought, this should be quite easy, but I am stacking ...
Anybody an idea (built-in tool, plugin, ...) for me?

By the way: I already found the Freehand raster georeferencer plugin, which works quite smart for some similar purposes, I think. But not for my current case. It's just freehand and cannot use both (snapping or typing in cordinates). Furtheron, it does not use the QGIS-layer-properties, but an proprietary layer-properties format discarding also the layer-CRS-information.

Edit referring to bugmenot123:

  • I cannot really say the georeference ist wrong, or what exactly is wrong. The only thing I know for sure, that my TrueDOPs differ from my Sentinel imagery by an offset of about 20 m. And that my Sentinel-Imagery ist coregistered to Landsat, so the Sentinels' georeferencing accuracy should now be quite good. At least visual control suggests that: Sentinel-images match now quite well to Landsat and between each other.
    Thus, I rather guess, that something with the TrueDOPs is wrong.
    Here an example of the offset
    o At the first image you see a section of the floodplain (one of my TrueDOPs), with a red line along the water channels (and a segement of the street at the right).
    o The second figure shows the red line and in the background one of the my Sentinel images (NIR-Band), of course with according date. White (to very bright green) are water channels. As you will quickly see, there is an offset of about 20 meters = two pixels, mainly in an East-West-direction.

enter image description here enter image description here

  • I don't know how the TrueDOPs are georeferrenced. I got them from Italian authorities. The only thing I know at the moment is that the creation of the TrueDOPs is outsourced to a private company. The only general informations I have according to the website are: Original reference system is RDN2008-TM33NE.
    (I already asked the authorities for the way the company is using. Unfortunatly I get no answer at the moment because of holidays. But I am not sure whether an answer will help much to me, because I expect the answer to be very specific, probably too specific for me, as I am not a geographer, but an ecologist. Anyway I don't want to rely too much on still getting an answer from there).
  • Metadata: Here the layer-properties/information of one of my ecw-TrueDOPs enter image description here
  • I don't know what sidecar files are. If you mean external metadata files, I do not have any. I just had a quick look at the download website, but I could not find any.

So, if I cannot figure out a specific error and correct it, I would tend to move my TrueDOPs this 20 meters freehand or by eye, respectively (I need them for classification purposes), but would like to move them all exactly the same and traceable ammount. With the mentionned freehand tool this is not possible.

11
  • 2
    This is not a full answer, thus a comment: Before attempting your geo-referencing, I would strongly recommend that you establish a single CRS (using meters or feet as its unit of measure) for all of your data, and project all data to that CRS.
    – Stu Smith
    Commented Jul 26, 2021 at 17:24
  • 2
    So is your georeference wrong or do you want to somehow override it for another reason? How is your imagery georeferenced? Embedded metadata? External sidecar files? Commented Jul 26, 2021 at 17:31
  • 1
    Try gdal_warp with tap option
    – vinh
    Commented Jul 27, 2021 at 15:16
  • 1
    Maybe isn't easy to get the image coordinates (row/col of pixel) and the georeferenced coordinates (Northing/Easting) inside the same canvas, so the georeferencer had always its own canvas for image coordinates. And is not possible (I guess) georeference two images with the same control points, because for each image, same image coordinates are related to different georeferenced ones. So I think the best we can do is perform an affine transformation (translation and maybe some rotation or uniform scale) to all the images, it can be done with gdalwarp -ct (proj affine transformation pipeline) Commented Jul 28, 2021 at 2:50
  • _ @bugmenot123. Thanks for your response. See edited question.
    – jaysigg
    Commented Jul 28, 2021 at 7:25

3 Answers 3

3

We can perform the same affine transformation to all the images.

To create b.tif, wich is moved 20 m to the West and 10 m to the North, from a.tif, in its own coordinates reference system:

gdalwarp -ct "+proj=affine +xoff=-20 +yoff=10" a.tif b.tif

It can also be done in QGIS from the GDAL Warp (reproject) processing algortihm, including the -ct "(proj transformation type string)" additional command-line parameter:

1

The affine transformation can include rotations and independent scale for each dimension: https://proj.org/operations/transformations/affine.html

About gdalwarp: https://gdal.org/programs/gdalwarp.html

2
  • Great, this sounds in any case to be a solution! But, would it be possible as well, analoguos to your warp method, just to modify the layer-assigned CRS? What I mean is to change the 'EPSG:32633-WGS84/TMzone33N' into a custom 'EPSG:32633-WGS84/TMzone33N-+xoff=-20+yoff=10'-CRS? So that i get just a 'warped view' of the image instead of modifying the image itself. I hope you unterstand what I mean. Thus, I would save the recalculation of all my TrueDOPs. I hope you won't despair of me :-)
    – jaysigg
    Commented Jul 29, 2021 at 15:51
  • I understand. Yes, it is possible. I need to test if it works. Commented Jul 29, 2021 at 18:51
1

We can create a new, derived through an affine transformation from a projected, CRS.

Instead of transforming the position of a layer within a reference frame, we can transform the reference frame in the reverse direction, leaving the position of the layer source dataset intact.

If we consider that by moving the layer 20 meters to the West and 10 meters to the North, we would take it where it belongs, within the EPSG:8687 system (which is the original one of the source dataset), we can create a new system that is a derivation of EPSG:8687 through an affine transformation that moves it 20 meters East and 10 meters South.

Therefore, the layer source dataset would remain in its original coordinates, but we will indicate to the applications that those coordinates must be interpreted in this new reference system.

To do that, we will use the Coordinate operation method: EPSG:9624 (Affine parametric transformation) , included within a WKT definition of a CRS derived from a projected one:

DERIVEDPROJCRS["8687-derived",
    BASEPROJCRS["Slovenia 1996 / UTM zone 33N",
        BASEGEOGCRS["Slovenia 1996",
            DATUM["Slovenia Geodetic Datum 1996",
                ELLIPSOID["GRS 1980",6378137,298.257222101,
                    LENGTHUNIT["metre",1
                    ]
                ]
            ],
            PRIMEM["Greenwich",0,
                ANGLEUNIT["degree",0.0174532925199433
                ]
            ],
            ID["EPSG",4765
            ]
        ],
        CONVERSION["UTM zone 33N",
            METHOD["Transverse Mercator",
                ID["EPSG",9807
                ]
            ],
            PARAMETER["Latitude of natural origin",0,
                ANGLEUNIT["degree",0.0174532925199433
                ],
                ID["EPSG",8801
                ]
            ],
            PARAMETER["Longitude of natural origin",15,
                ANGLEUNIT["degree",0.0174532925199433
                ],
                ID["EPSG",8802
                ]
            ],
            PARAMETER["Scale factor at natural origin",0.9996,
                SCALEUNIT["unity",1
                ],
                ID["EPSG",8805
                ]
            ],
            PARAMETER["False easting",500000,
                LENGTHUNIT["metre",1
                ],
                ID["EPSG",8806
                ]
            ],
            PARAMETER["False northing",0,
                LENGTHUNIT["metre",1
                ],
                ID["EPSG",8807
                ]
            ]
        ]
    ],
    DERIVINGCONVERSION["Affine",
        METHOD["Affine parametric transformation",
            ID["EPSG",9624
            ]
        ],
        PARAMETER["A0",20,
            LENGTHUNIT["metre",1
            ],
            ID["EPSG",8623
            ]
        ],
        PARAMETER["A1",1,
            SCALEUNIT["coefficient",1
            ],
            ID["EPSG",8624
            ]
        ],
        PARAMETER["A2",0,
            SCALEUNIT["coefficient",1
            ],
            ID["EPSG",8625
            ]
        ],
        PARAMETER["B0",-10,
            LENGTHUNIT["metre",1
            ],
            ID["EPSG",8639
            ]
        ],
        PARAMETER["B1",0,
            SCALEUNIT["coefficient",1
            ],
            ID["EPSG",8640
            ]
        ],
        PARAMETER["B2",1,
            SCALEUNIT["coefficient",1
            ],
            ID["EPSG",8641
            ]
        ]
    ],
    CS[Cartesian,2
    ],
    AXIS["(E)",east,
        ORDER[1
        ],
        LENGTHUNIT["metre",1
        ]
    ],
    AXIS["(N)",north,
        ORDER[2
        ],
        LENGTHUNIT["metre",1
        ]
    ]
]

A0 and B0 parameters are the translations. A1, A2, B1 and B2 parameters are the (2D) scaled rotations.

Add a custom CRS from the above WKT definition in QGIS and Set (do not project) the new CRS to the layers to be adjusted.

You can change the values and re-set the CRS of the layers any times. When you're done, you can export the layers to other well-known reference system.

19
  • Wow, oookeeey , I had just a quick look for now. Into detail I will go tomorrow. Thanks very much so far!!!! You will hear of me of course again!
    – jaysigg
    Commented Jul 30, 2021 at 14:10
  • Only one question at the moment: As my project CRS is EPSG:32633 (not EPSG:8687 Slovenia 1996). Can I change the base CRS easily to 32633?
    – jaysigg
    Commented Jul 30, 2021 at 14:17
  • The source data (the file 04906106.ecw) of the layer is referenced to EPSG: 8687, so you can move it within that frame, or move that frame. You can reproject those files to another system and define a CRS derived from the new reference. Commented Jul 30, 2021 at 16:40
  • In the WKT string, replace the BASEPROJCRS node with the PROJCRS node of the new CRS definition. Commented Jul 30, 2021 at 16:42
  • 1
    Hi @Gabriel again. As this thread guess is long enough I opened a new question onto this issue: gis.stackexchange.com/questions/408683/…
    – jaysigg
    Commented Aug 19, 2021 at 13:54
1

This is my result for the EPSG:32633-affine-CRS.

First, as you last comments were not absolutely clear for me / to avoid misunderstandings:

  • The internal EPSG of my TrueDops is EPSG:8687 (or to be exact, they are automatically loaded to QGIS as 8687. So, to be honest I don't know whether the TrueDOPs have an internal base CRS).
  • I want to view the TrueDOPs as EPSG:32633 (= my project CRS), with the additional shift of some meters.

Here my EPSG:32633-affine-CRS, in this case 20 m towards west, and 0, not 10 m towards north. (The normal 32633-string you will find afterwards.)

DERIVEDPROJCRS["32633-derived",
BASEPROJCRS["WGS 84 / UTM zone 33N",
    BASEGEOGCRS["WGS 84",
        DATUM["World Geodetic System 1984",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4326]],
    CONVERSION["UTM zone 33N",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",15,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]]],
DERIVINGCONVERSION["Affine",
    METHOD["Affine parametric transformation",
        ID["EPSG",9624]],
    PARAMETER["A0",20,
        LENGTHUNIT["metre",1],
        ID["EPSG",8623]],
    PARAMETER["A1",1,
        SCALEUNIT["coefficient",1],
        ID["EPSG",8624]],
    PARAMETER["A2",0,
        SCALEUNIT["coefficient",1],
        ID["EPSG",8625]],
    PARAMETER["B0",0,
        LENGTHUNIT["metre",1],
        ID["EPSG",8639]],
    PARAMETER["B1",0,
        SCALEUNIT["coefficient",1],
        ID["EPSG",8640]],
    PARAMETER["B2",1,
        SCALEUNIT["coefficient",1],
        ID["EPSG",8641]]],
CS[Cartesian,2],
    AXIS["(E)",east,
        ORDER[1],
        LENGTHUNIT["metre",1]],
    AXIS["(N)",north,
        ORDER[2],
        LENGTHUNIT["metre",1]],
USAGE[
    SCOPE["unknown"],
    AREA["World - N hemisphere - 12°E to 18°E - by country"],
    BBOX[0,12,84,18]],
ID["EPSG",32633]]

Here the normal 32633-string out of QGis:

PROJCRS["WGS 84 / UTM zone 33N",
BASEGEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]],
CONVERSION["UTM zone 33N",
    METHOD["Transverse Mercator",
        ID["EPSG",9807]],
    PARAMETER["Latitude of natural origin",0,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8801]],
    PARAMETER["Longitude of natural origin",15,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8802]],
    PARAMETER["Scale factor at natural origin",0.9996,
        SCALEUNIT["unity",1],
        ID["EPSG",8805]],
    PARAMETER["False easting",500000,
        LENGTHUNIT["metre",1],
        ID["EPSG",8806]],
    PARAMETER["False northing",0,
        LENGTHUNIT["metre",1],
        ID["EPSG",8807]]],
CS[Cartesian,2],
    AXIS["(E)",east,
        ORDER[1],
        LENGTHUNIT["metre",1]],
    AXIS["(N)",north,
        ORDER[2],
        LENGTHUNIT["metre",1]],
USAGE[
    SCOPE["unknown"],
    AREA["World - N hemisphere - 12°E to 18°E - by country"],
    BBOX[0,12,84,18]],
ID["EPSG",32633]]

What do you mean?

3
  • gdalinfo shows that EPSG:8687 is the reference for the data source, most probably it is defined internally. If you want to reference it to EPSG:32633, just reproject it. Next, you can assign the 32633-affine-CRS to the reprojected layer. Since the only difference between both (8687 and 32633) CRSes is the datum, you can assign any of them to the layer, but it is better if you reproject the data source before to assign the derived CRS. If you want to see differences to a better understand, reproject the datasource to a really different projection and try to assign the derived CRS to it. Commented Jul 31, 2021 at 14:58
  • "gdalinfo shows that EPSG:8687...." That's interesting. Where can I see this information? (My layer-properties' information shows only the assigned projection.)
    – jaysigg
    Commented Jul 31, 2021 at 15:17
  • I'm sorry, was confused about the screenshot. Just run the gdalinfo tool to the source data file, not the layer. Commented Jul 31, 2021 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.