-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
speed up image rebuilds and better UT for lerc
- Loading branch information
Showing
5 changed files
with
41 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
FROM pc-apis-stac | ||
|
||
COPY requirements-dev.txt requirements-dev.txt | ||
RUN pip install -r requirements-dev.txt | ||
|
||
RUN pip install -e ./pccommon[dev] -e ./pcstac | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
--mount=type=bind,source=requirements-dev.txt,target=requirements-dev.txt \ | ||
pip install -r requirements-dev.txt | ||
|
||
RUN --mount=type=cache,target=/root/.cache \ | ||
pip install -e ./pccommon[dev] -e ./pcstac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import planetary_computer as pc | ||
import rasterio | ||
from titiler.core import utils as titiler_utils | ||
|
||
|
||
def test_rasterio_lerc_decompression() -> None: | ||
# Read a LERC file from Planetary Computer | ||
url = "https://usgslidareuwest.blob.core.windows.net/usgs-3dep-cogs/usgs-cogs/USGS_LPC_VA_Fairfax_County_2018/hag/USGS_LPC_VA_Fairfax_County_2018-hag-2m-3-1.tif" | ||
url = ( | ||
"https://usgslidareuwest.blob.core.windows.net/" | ||
"usgs-3dep-cogs/usgs-cogs/" | ||
"USGS_LPC_VA_Fairfax_County_2018/hag/" | ||
"USGS_LPC_VA_Fairfax_County_2018-hag-2m-3-1.tif" | ||
) | ||
signed_url = pc.sign(url) | ||
# Although we call rasterio, this is really testing GDAL's LERC support. | ||
# If the version of GDAL being shipped doesn't support LERC, then an exception like | ||
# "rasterio.errors.RasterioIOError: Cannot open TIFF file due to missing codec."" | ||
# Would be thrown. | ||
with rasterio.open(signed_url) as src: | ||
compression = src.profile.get('compress') | ||
assert compression == 'lerc_zstd' | ||
compression = src.profile.get("compress") | ||
assert compression == "lerc_zstd" |