EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 9bbf5b04 authored by Fabian Schindler's avatar Fabian Schindler
Browse files

Fixing browse report generation.

Fixing georeferencing when using TPS reprojection.
Using GDAL 3.1.2 for preprocessor.
parent 23c9a7aa
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@
#-----------------------------------------------------------------------------
# FROM osgeo/gdal:ubuntu-full-latest
FROM osgeo/gdal:ubuntu-full-3.0.4
FROM osgeo/gdal:ubuntu-full-3.1.2
MAINTAINER EOX
LABEL name="prism view server preprocessor" \
......
......@@ -251,8 +251,6 @@ def preprocess_browse(config: dict, browse_type: str, browse: dict, use_dir: os.
parsed = urlparse(filename)
print(filename)
print(parsed)
if not parsed.scheme:
# check if we can reuse a previous download
if not os.path.isdir('download'):
......
......@@ -31,8 +31,12 @@ def apply_browse_report_georeference(input_filename: os.PathLike, target_filenam
col_rows = browse['footprint']['col_row_list']
coords = browse['footprint']['coord_list']
if col_rows[0] == col_rows[-1] and coords[0] == coords[-1]:
col_rows = col_rows[:-1]
coords = coords[:-1]
gcps = [
gdal.GCP(coord[0], coord[1], 0, col_row[0], col_row[1])
gdal.GCP(coord[1], coord[0], 0, col_row[0], col_row[1])
for col_row, coord in zip(col_rows, coords)
]
......
......@@ -52,12 +52,21 @@ def gcp_georef(input_filename: os.PathLike, target_filename: os.PathLike, order:
# otherwise warp
if not succeded:
logger.info("Applying GCP transform by warping")
if tps:
options = {
'tps': tps
}
else:
options = {
'polynomialOrder': order
}
gdal.Warp(
target_filename,
input_filename,
polynomialOrder=order,
dstSRS=projection,
tps=tps,
**options,
)
def rpc_georef(input_filename: os.PathLike, target_filename: os.PathLike, rpc_file_template: str='{fileroot}.RPC', warp_options: dict=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment