Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PySegCNN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
earth_observation_public
PySegCNN
Commits
ca9730df
Commit
ca9730df
authored
4 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Added a utility function to mosaic rasters.
parent
ce8878e1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pysegcnn/core/utils.py
+15
-0
15 additions, 0 deletions
pysegcnn/core/utils.py
with
15 additions
and
0 deletions
pysegcnn/core/utils.py
+
15
−
0
View file @
ca9730df
...
...
@@ -2451,3 +2451,18 @@ def gdb2shp(src_ds, feature=''):
# call the osgeo ogr2ogr system utility
subprocess
.
run
(
'
ogr2ogr -f
"
ESRI Shapefile
"
{} {} {}
'
.
format
(
src_ds
,
src_ds
.
parent
,
feature
))
def
merge_tifs
(
trg_ds
,
tifs
):
"""
Mosaic a set of images.
Parameters
----------
trg_ds : `str` or :py:class:`pathlib.Path`
Path to the output GeoTiff file.
tifs : `list` [`str` or :py:class:`pathlib.Path`]
List of paths to the GeoTiffs to mosaic.
"""
LOGGER
.
info
(
'
Creating mosaic: {}
'
.
format
(
trg_ds
))
gdal
.
Warp
(
str
(
trg_ds
),
[
str
(
tif
)
for
tif
in
tifs
])
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