stactools
stactools copied to clipboard
add optional override "degrees" projection instead of hardwired to EPSG:4326
Instead of hard-wiring EPSG:4326, perhaps it can still be the default, but allow for other off-Earth bodies (e.g. "IAU" codes).
Recommendations:
- https://github.com/stac-utils/stactools/blob/ec6585503746b96c9ef668a287401fbb5c76e080/src/stactools/core/utils/raster_footprint.py#L263 to
def densify_reproject_simplify(
polygon: Polygon,
crs: CRS,
crs_deg: str = "EPSG:4326",
densification_factor: Optional[int] = None,
precision: int = DEFAULT_PRECISION,
simplify_tolerance: Optional[float] = None,
) -> Polygon:
- https://github.com/stac-utils/stactools/blob/ec6585503746b96c9ef668a287401fbb5c76e080/src/stactools/core/utils/raster_footprint.py#L305
to
polygon = shape(transform_geom(crs, crs_deg, polygon, precision=precision))
No objections here, pull request welcome! Let me know if you don't want to implement, and I can take this on.
Thanks for the up-vote. I will see what I can do for a pull request. I haven't yet assessed the impact. Since this may be a breaking change to the function, I was worried it might break existing workflows (or code). I haven't really searched around much for the function's use.
If you think the update is minor (or early on), I will happy request a pull with the two changes I proposed.
thanks.
Since this may be a breaking change to the function, I was worried it might break existing workflows (or code).
A new, optional argument with a default that keeps current behavior would be a feature-adding, non-breaking change.