stactools icon indicating copy to clipboard operation
stactools copied to clipboard

add optional override "degrees" projection instead of hardwired to EPSG:4326

Open thareUSGS opened this issue 2 years ago • 3 comments

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:

  1. 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:
  1. 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))

thareUSGS avatar Sep 16 '22 20:09 thareUSGS

No objections here, pull request welcome! Let me know if you don't want to implement, and I can take this on.

gadomski avatar Sep 19 '22 13:09 gadomski

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.

thareUSGS avatar Sep 22 '22 15:09 thareUSGS

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.

gadomski avatar Sep 22 '22 15:09 gadomski