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

Add find_max_value_coords function #907

Merged
merged 1 commit into from
Sep 29, 2024
Merged

Add find_max_value_coords function #907

merged 1 commit into from
Sep 29, 2024

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Sep 29, 2024

import leafmap

# Example usage:
geotiff_file = "cog.tif"

# Without specifying dst_crs, it will return original x, y
x, y, max_value = leafmap.find_max_value_coords(geotiff_file)
print(f"Original Coordinates: (x: {x}, y: {y}), Maximum Value: {max_value}")

# With dst_crs (e.g., EPSG:4326 for lat/lon)
x, y, max_value = leafmap.find_max_value_coords(geotiff_file, dst_crs="EPSG:4326")
print(f"Reprojected Coordinates: (x: {x}, y: {y}), Maximum Value: {max_value}")

@giswqs giswqs merged commit a9d1f96 into master Sep 29, 2024
12 of 14 checks passed
@giswqs giswqs deleted the max branch September 29, 2024 01:01
giswqs added a commit that referenced this pull request Oct 30, 2024
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 this pull request may close these issues.

1 participant