Skip to content

Commit

Permalink
Merge pull request #440 from wri/gtc-2580_robustify_vector_tiles
Browse files Browse the repository at this point in the history
GTC-2580: Make vector rasterization more robust by using latest PixETL version
  • Loading branch information
dmannarino authored Nov 22, 2023
2 parents a89360d + 234c01e commit 64e1cfb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
5 changes: 2 additions & 3 deletions batch/pixetl.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM globalforestwatch/pixetl:v1.7.4

FROM globalforestwatch/pixetl:v1.7.5

# Copy scripts
COPY ./batch/scripts/ /opt/scripts/
Expand All @@ -19,4 +18,4 @@ WORKDIR /tmp
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

ENTRYPOINT ["/opt/scripts/report_status.sh"]
ENTRYPOINT ["/opt/scripts/report_status.sh"]
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def client():
except Exception as ex:
print(f"Exception deleting asset {asset['asset_id']}: {ex}")
try:
# FIXME: Mock-out cache invalidation function
_ = client.delete(f"/dataset/{ds_id}/{version}")
except Exception as ex:
print(f"Exception deleting version {version}: {ex}")
Expand Down
21 changes: 10 additions & 11 deletions tests/routes/datasets/test_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import httpx
import pytest
from botocore.exceptions import ClientError
from httpx import AsyncClient

from app.application import ContextEngine
from app.crud import tasks
Expand Down Expand Up @@ -255,21 +256,22 @@ async def test_auxiliary_raster_asset(async_client, httpd, logs):


@pytest.mark.asyncio
async def test_auxiliary_vector_asset(async_client, batch_client, httpd):
async def test_rasterize_vector_asset(async_client: AsyncClient, batch_client, httpd):
""""""
_, logs = batch_client

# Add a dataset, version, and default asset
dataset = "test_vector"
version = "v1.1.1"
grid = "10/40000"

pixetl_output_files = [
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/gdal-geotiff/extent.geojson",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/geotiff/extent.geojson",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/gdal-geotiff/tiles.geojson",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/geotiff/tiles.geojson",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/gdal-geotiff/90N_000E.tif",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/geotiff/90N_000E.tif",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/gdal-geotiff/extent.geojson",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/geotiff/extent.geojson",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/gdal-geotiff/tiles.geojson",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/geotiff/tiles.geojson",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/gdal-geotiff/60N_010E.tif",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/geotiff/60N_010E.tif",
]

for key in pixetl_output_files:
Expand All @@ -294,15 +296,12 @@ async def test_auxiliary_vector_asset(async_client, batch_client, httpd):
# vector asset
asset_payload = {
"asset_type": "Raster tile set",
"asset_uri": "http://www.osnews.com",
"is_managed": True,
"creation_options": {
"data_type": FAKE_INT_DATA_PARAMS["dtype"],
"pixel_meaning": "gfw_fid",
"grid": "90/27008",
"grid": grid,
"resampling": "nearest",
"overwrite": True,
"subset": "90N_000E",
},
}

Expand Down

0 comments on commit 64e1cfb

Please sign in to comment.