Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Basemap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Dreutter
Basemap
Commits
3abc58ef
Commit
3abc58ef
authored
4 years ago
by
Simon Dreutter
Browse files
Options
Downloads
Patches
Plain Diff
Fixed pole gap issue with gdal warp options
parent
12cc9373
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
process/4_process_gebco.py
+5
-21
5 additions, 21 deletions
process/4_process_gebco.py
process/config.py
+2
-1
2 additions, 1 deletion
process/config.py
with
7 additions
and
22 deletions
process/4_process_gebco.py
+
5
−
21
View file @
3abc58ef
...
@@ -51,7 +51,7 @@ print('============================================================')
...
@@ -51,7 +51,7 @@ print('============================================================')
print
(
'
GENERAL BATHYMETRIC CHART OF THE OCEANS / GEBCO
'
)
print
(
'
GENERAL BATHYMETRIC CHART OF THE OCEANS / GEBCO
'
)
msg
=
'
Resampling GEBCO...
'
msg
=
'
Resampling GEBCO...
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_WORLD
}
-t_srs
{
EPSG_WORLD
}
-tr
{
RESOLUTION_DEG
}
{
RESOLUTION_DEG
}
-r cubic -of GTiff
{
GDAL_CREATE_OPTIONS
}
{
GEBCO_IN
}
{
GEBCO_WORLD
}
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_WORLD
}
-t_srs
{
EPSG_WORLD
}
-tr
{
RESOLUTION_DEG
}
{
RESOLUTION_DEG
}
-r cubic -of GTiff
{
WARP_OPTIONS
}
{
GDAL_CREATE_OPTIONS
}
{
GEBCO_IN
}
{
GEBCO_WORLD
}
'
run
(
msg
,
cmd
)
run
(
msg
,
cmd
)
msg
=
'
Clipping GEBCO for the Arctic...
'
msg
=
'
Clipping GEBCO for the Arctic...
'
...
@@ -59,40 +59,24 @@ cmd = f'gdal_translate -projwin -180.0 90.0 180.0 {ARCTIC_EXTENT_LAT} -a_srs {EP
...
@@ -59,40 +59,24 @@ cmd = f'gdal_translate -projwin -180.0 90.0 180.0 {ARCTIC_EXTENT_LAT} -a_srs {EP
run
(
msg
,
cmd
)
run
(
msg
,
cmd
)
msg
=
'
Reprojecting GEBCO for the Arctic...
'
msg
=
'
Reprojecting GEBCO for the Arctic...
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_WORLD
}
-t_srs
{
EPSG_ARCTIC
}
-r near -of VRT
{
GEBCO_ARCTIC_CLIP_VRT
}
{
GEBCO_ARCTIC_FULL_VRT
}
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_WORLD
}
-t_srs
{
EPSG_ARCTIC
}
-r near -of VRT
{
WARP_OPTIONS
}
{
GEBCO_ARCTIC_CLIP_VRT
}
{
GEBCO_ARCTIC_FULL_VRT
}
'
run
(
msg
,
cmd
)
run
(
msg
,
cmd
)
msg
=
'
Resampling Arctic to target resolution...
'
msg
=
'
Resampling Arctic to target resolution...
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_ARCTIC
}
-t_srs
{
EPSG_ARCTIC
}
-tr
{
RESOLUTION_M
}
{
RESOLUTION_M
}
-r cubic -of GTiff
{
GDAL_CREATE_OPTIONS
}
{
GEBCO_ARCTIC_FULL_VRT
}
{
TMP_POLAR
}
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_ARCTIC
}
-t_srs
{
EPSG_ARCTIC
}
-tr
{
RESOLUTION_M
}
{
RESOLUTION_M
}
-r cubic -of GTiff
{
WARP_OPTIONS
}
{
GDAL_CREATE_OPTIONS
}
{
GEBCO_ARCTIC_FULL_VRT
}
{
GEBCO_ARCTIC
}
'
#{GEBCO_ARCTIC}
run
(
msg
,
cmd
)
run
(
msg
,
cmd
)
# TEMPORARY
msg
=
'
Filling North Pole gap...
'
cmd
=
f
'
{
PYTHON
}
-m gdal_fillnodata -md
{
interpolation
}
-b 1 -of GTiff
{
TMP_POLAR
}
{
GEBCO_ARCTIC
}
'
run
(
msg
,
cmd
)
cleanup
(
TMP_POLAR
)
# /TEMPORARY
msg
=
'
Clipping GEBCO for the Antarctic...
'
msg
=
'
Clipping GEBCO for the Antarctic...
'
cmd
=
f
'
gdal_translate -projwin -180.0
{
ANTARCTIC_EXTENT_LAT
}
180.0 -90.0 -a_srs
{
EPSG_WORLD
}
-of VRT
{
GEBCO_IN
}
{
GEBCO_ANTARCTIC_CLIP_VRT
}
'
cmd
=
f
'
gdal_translate -projwin -180.0
{
ANTARCTIC_EXTENT_LAT
}
180.0 -90.0 -a_srs
{
EPSG_WORLD
}
-of VRT
{
GEBCO_IN
}
{
GEBCO_ANTARCTIC_CLIP_VRT
}
'
run
(
msg
,
cmd
)
run
(
msg
,
cmd
)
msg
=
'
Reprojecting GEBCO for the Antarctic...
'
msg
=
'
Reprojecting GEBCO for the Antarctic...
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_WORLD
}
-t_srs
{
EPSG_ANTARCTIC
}
-r near -of VRT
{
GEBCO_ANTARCTIC_CLIP_VRT
}
{
GEBCO_ANTARCTIC_FULL_VRT
}
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_WORLD
}
-t_srs
{
EPSG_ANTARCTIC
}
-r near -of VRT
{
WARP_OPTIONS
}
{
GEBCO_ANTARCTIC_CLIP_VRT
}
{
GEBCO_ANTARCTIC_FULL_VRT
}
'
run
(
msg
,
cmd
)
run
(
msg
,
cmd
)
msg
=
'
Resampling Antarctic to target resolution...
'
msg
=
'
Resampling Antarctic to target resolution...
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_ANTARCTIC
}
-t_srs
{
EPSG_ANTARCTIC
}
-tr
{
RESOLUTION_M
}
{
RESOLUTION_M
}
-r cubic -of GTiff
{
GDAL_CREATE_OPTIONS
}
{
GEBCO_ANTARCTIC_FULL_VRT
}
{
TMP_POLAR
}
'
cmd
=
f
'
gdalwarp -s_srs
{
EPSG_ANTARCTIC
}
-t_srs
{
EPSG_ANTARCTIC
}
-tr
{
RESOLUTION_M
}
{
RESOLUTION_M
}
-r cubic -of GTiff
{
WARP_OPTIONS
}
{
GDAL_CREATE_OPTIONS
}
{
GEBCO_ANTARCTIC_FULL_VRT
}
{
GEBCO_ANTARCTIC
}
'
#{GEBCO_ANTARCTIC}
run
(
msg
,
cmd
)
# TEMPORARY
msg
=
'
Filling South Pole gap...
'
cmd
=
f
'
{
PYTHON
}
-m gdal_fillnodata -md
{
interpolation
}
-b 1 -of GTiff
{
TMP_POLAR
}
{
GEBCO_ANTARCTIC
}
'
run
(
msg
,
cmd
)
run
(
msg
,
cmd
)
cleanup
(
TMP_POLAR
)
# /TEMPORARY
cleanup
(
GEBCO_ARCTIC_CLIP_VRT
)
cleanup
(
GEBCO_ARCTIC_CLIP_VRT
)
cleanup
(
GEBCO_ARCTIC_FULL_VRT
)
cleanup
(
GEBCO_ARCTIC_FULL_VRT
)
...
...
This diff is collapsed.
Click to expand it.
process/config.py
+
2
−
1
View file @
3abc58ef
...
@@ -201,7 +201,6 @@ GEBCO_ANTARCTIC = os.path.join(PATH_GEBCO,'GEBCO_antarctic.tif')
...
@@ -201,7 +201,6 @@ GEBCO_ANTARCTIC = os.path.join(PATH_GEBCO,'GEBCO_antarctic.tif')
GEBCO_ANTARCTIC_HILLSHADE
=
os
.
path
.
join
(
PATH_GEBCO
,
'
GEBCO_antarctic_hillshade.tif
'
)
GEBCO_ANTARCTIC_HILLSHADE
=
os
.
path
.
join
(
PATH_GEBCO
,
'
GEBCO_antarctic_hillshade.tif
'
)
# temporary files
# temporary files
TMP_POLAR
=
os
.
path
.
join
(
PATH_GEBCO
,
'
tmp_polar.tif
'
)
# DEBUGGING
TMP_RGB
=
os
.
path
.
join
(
PATH_GEBCO
,
'
tmp_rgb.tif
'
)
TMP_RGB
=
os
.
path
.
join
(
PATH_GEBCO
,
'
tmp_rgb.tif
'
)
TMP_SHADED
=
os
.
path
.
join
(
PATH_GEBCO
,
'
tmp_shaded.tif
'
)
TMP_SHADED
=
os
.
path
.
join
(
PATH_GEBCO
,
'
tmp_shaded.tif
'
)
...
@@ -264,6 +263,8 @@ GDAL_CREATE_OPTIONS = '-co COMPRESS=NONE -co BIGTIFF=IF_NEEDED'
...
@@ -264,6 +263,8 @@ GDAL_CREATE_OPTIONS = '-co COMPRESS=NONE -co BIGTIFF=IF_NEEDED'
GDAL_CREATE_OPTIONS_PY
=
'
--co COMPRESS=NONE --co BIGTIFF=IF_NEEDED
'
GDAL_CREATE_OPTIONS_PY
=
'
--co COMPRESS=NONE --co BIGTIFF=IF_NEEDED
'
#GDAL_CREATE_OPTIONS_PY = '--co COMPRESS=DEFLATE --co PREDICTOR=2 --co ZLEVEL=9 --co BIGTIFF=YES'
#GDAL_CREATE_OPTIONS_PY = '--co COMPRESS=DEFLATE --co PREDICTOR=2 --co ZLEVEL=9 --co BIGTIFF=YES'
# GDAL warp options
WARP_OPTIONS
=
'
-wo SOURCE_EXTRA=1000 -et 0
'
#=============================================================================
#=============================================================================
# RUN FUNCTION
# RUN FUNCTION
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment