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

Remove deprecated skip_equivalent pyproj arg #174

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions stackstac/geom_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ def bounds_from_affine(
ys = [ul_y, ll_y, lr_y, ur_y]

if from_epsg != to_epsg:
transformer = cached_transformer(
from_epsg, to_epsg, skip_equivalent=True, always_xy=True
)
transformer = cached_transformer(from_epsg, to_epsg, always_xy=True)
# TODO handle error
xs_proj, ys_proj = transformer.transform(xs, ys, errcheck=True)
else:
Expand All @@ -50,9 +48,7 @@ def reproject_bounds(bounds: Bbox, from_epsg: int, to_epsg: int) -> Bbox:
# read this in pairs, downward by column
xs = [minx, minx, maxx, maxx]
ys = [maxy, miny, miny, maxy]
transformer = cached_transformer(
from_epsg, to_epsg, skip_equivalent=True, always_xy=True
)
transformer = cached_transformer(from_epsg, to_epsg, always_xy=True)
xs_proj, ys_proj = transformer.transform(xs, ys, errcheck=True) # TODO handle error
return min(xs_proj), min(ys_proj), max(xs_proj), max(ys_proj)

Expand Down Expand Up @@ -288,9 +284,7 @@ def reproject_array(
# We do this by, for each point in the output grid, generating
# the coordinates in the _input_ CRS that correspond to that point.

reverse_transformer = cached_transformer(
spec.epsg, from_epsg, skip_equivalent=True, always_xy=True
)
reverse_transformer = cached_transformer(spec.epsg, from_epsg, always_xy=True)

xs, ys = np.meshgrid(x, y, copy=False)
src_xs, src_ys = reverse_transformer.transform(xs, ys, errcheck=True)
Expand Down
2 changes: 1 addition & 1 deletion stackstac/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def prepare_items(
)

transformer = geom_utils.cached_transformer(
asset_epsg, out_epsg, skip_equivalent=True, always_xy=True
asset_epsg, out_epsg, always_xy=True
)
out_px_corner_xs, out_px_corner_ys = transformer.transform(
px_corner_xs, px_corner_ys, errcheck=True
Expand Down