Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel shift when dst_area_or_point == 'Point' #31

Closed
kanglcn opened this issue Apr 13, 2022 · 1 comment · Fixed by #33
Closed

Pixel shift when dst_area_or_point == 'Point' #31

kanglcn opened this issue Apr 13, 2022 · 1 comment · Fixed by #33

Comments

@kanglcn
Copy link

kanglcn commented Apr 13, 2022

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
Copy link
Collaborator

cmarshak commented May 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants