Closed wangleping2000 closed 2 weeks ago
Partly overlapping images can be easily handled, that is not the problem. However, your input images should have proper geocoding information. Please run gdalinfo </path/to/image>
on both of your input images and post the output here. Please also post the entire error traceback.
I think it is because abnormality of projection. Actually, this error disappeared when I reduced the number of max_points and the code ran successfully. But the corrected image does not have the spatial reference. So I checked the spatial referenen of the original image and found the loss of that.
dataset = gdal.Open(r'xxxxx.tiff')
geotranform = dataset.GetGeoTransform()
projection = dataset.GetProjection()
print('dataset',dataset)
print('projection',projection)
dataset <osgeo.gdal.Dataset; proxy of <Swig Object of type 'GDALDatasetShadow *' at 0x000002293AA854B0> >
projection
When I checked my original image at Arcmap, the spatial reference was still here. D_WGS_1984: 'EPSG:4326' I think it is not the problem of arosics, but my satellite images.
Yes, looks like something is wrong with the projection of your input dataset. However, you can also pass an instance of GeoArray to AROSICS to enforce that AROSICS is using the correct projection:
from geoarray import GeoArray
from arosics import COREG_LOCAL
# geotransform expects something like dataset.GetGeoTransform(), projection expects a WKT string
reference = GeoArray('/path/to/image.tiff', geotransform=..., projection=...)
CRL = arosics.COREG_LOCAL(reference,correct_image,
grid_res=16,max_points=500,path_out=out_path,
fmt_out='GTIFF')
Let me know, if you got it working, so that the issue can be closed.
OK. Thank you very much.
---- Replied Message ---- | From | Daniel @.> | | Date | 10/17/2024 16:23 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [GFZ/arosics] A geotransform must be passed if mapPoly is given. (Issue #54) |
Yes, looks like something is wrong with the projection of your input dataset. However, you can also pass an instance of GeoArray to AROSICS to enforce that AROSICS is using the correct projection:
fromgeoarrayimportGeoArrayfromarosicsimportCOREG_LOCAL# geotransform expects something like dataset.GetGeoTransform(), projection expects a WKT stringreference=GeoArray('/path/to/image.tiff', geotransform=..., projection=...)
CRL=arosics.COREG_LOCAL(reference,correct_image, grid_res=16,max_points=500,path_out=out_path, fmt_out='GTIFF')
Let me know, if you got it working, so that the issue can be closed.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Description
Describe what you were trying to get done.
I have two images that are not totally overlapped. However, their size, resolution, and projection are samely. The first images have been matched. I want to use the first image as reference to match the second image.
Tell us what happened, what went wrong, and what you expected to happen.
But I get a error report called 'A geotransform must be passed if mapPoly is given'
This is my images in GIS.
What I Did
here is my code and error