ACCESS-Cloud-Based-InSAR / dem-stitcher

Download and merge DEM tiles
Apache License 2.0
41 stars 15 forks source link

Pixel shift when dst_area_or_point == 'Point' #31

Closed kanglcn closed 2 years ago

kanglcn commented 2 years ago

Hi,

Here is a slice of code in the stitcher.py:

    if dst_area_or_point == 'Point' and src_area_or_point == 'Area':
        x_shift = 1
        y_shift = 1
        array_shifted, profile_shifted = gdal_translate_profile(filepath, x_shift, y_shift)
    elif (dst_area_or_point == 'Area') and (src_area_or_point == 'Point'):
        shift = .5
        array_shifted, profile_shifted = gdal_translate_profile(filepath, shift, shift)
    # half shift down if glo30
    elif (dst_area_or_point == 'Point') and (src_area_or_point == 'Point'):
        x_shift = 1
        y_shift = 1
        array_shifted, profile_shifted = gdal_translate_profile(filepath, x_shift, y_shift)

I notice that x_shift and y_shift always equal to 1 if dst_area_or_point == 'Point' and no matter what src_area_or_point is. This looks a little strange to me. Is it a typo? If there is some reason behind it, I will appreciate it if you let me know.

Thanks!

cmarshak commented 2 years ago

Yes - this is not correct. It should be a half pixel shift. I am going to explain this in another issue ticket. Sorry for the late reply. I was on paternity leave. See #32