Closed pjhartzell closed 1 year ago
Free functions that duplicate class methods are now marked as deprecated since version 0.4.4. Should we bump that to 0.5.0?
We don't have an explicit deprecation policy, but IMO it's best to give at least one release cycle for the deprecations to kick in. So depreacted in 0.4.4, removal planned for 0.6.
Thoughts? Is the different underscoring a breaking change?
I think the problem was due to using rasterio wheels rather than building from scratch (f75b36c8d4d299ce32247dfe10827ba413876fdb). I agree that the test is a bit fragile but #401 should fix it.
Updated Description
Related Issue(s): None.
Description: The raster footprint utility often produces incorrect geometry polygons when the data spans the edge of the sinusoidal projection used by MODIS and VIIRS. A fix requires an alternative densification approach and a custom reprojection function. There is currently no convenient way to override these steps in the raster footprint utility since they are: 1) bundled into a single function (
densify_reproject_simplify
) and 2) that function exists at the end of a chain of function calls.This PR replicates the functionality of the raster footprint utility in a class (named
RasterFootprint
) with an eye toward subclassing for selective method overrides. In addition to breaking out individual methods for the densify, reproject, and simplify steps, alternative constructors are provided for footprint creation directly from an href or from a file opened with rasterio (a rasterio DatasetReader object). An alternative densification function is also provided; you can now choose to densify by factor or by distance.The existing raster footprint functions are retained, but marked as deprecated. Their functionality is fully contained in the new
RasterFootprint
class and the functions themselves now rely onRasterFootprint
.PR checklist:
scripts/format
).scripts/lint
).scripts/test
).Original Description (for context)
Related Issue(s): None.
Description: The raster footprint utility often produces incorrect and globe-spanning geometry polygons when the data is on the edge of the sinusoidal projection used by MODIS and VIIRS.
This PR provides a fix to create correct raster footprints at the edges of the sinusoidal projection.
Approach:
abs(longitude)
value greater than180
. This should be able to be done without the custom projection equations, but I am unable to forceproj
to not wrap the longitude coordinates.Notes:
sinusoidal_pixel_to_grid
function inprojection.py
. It will be used by the MODIS stactools-package and it seemed natural to place it alongside the newsinusoidal_grid_to_lonlat
function._densify()
to_densify_by_factor()
. The name parallels the new_densify_by_distance()
function used by the sinusoidal class.Example: Current, incorrect behavior (pink) for an h01v11 MODIS tile (MCD15A2H.A2022025.h01v11.061):
Proposed, correct behavior (green) via this PR for the same MODIS tile: