Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plio
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
Releases
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
aflab
astrogeology
Plio
Commits
5db0cb20
Commit
5db0cb20
authored
8 years ago
by
jlaura
Committed by
Jason R Laura
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Prints removed and fixes raster to raster matching to conform to GeoDataset API.
parent
3a7860ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plio/io/io_gdal.py
+8
-8
8 additions, 8 deletions
plio/io/io_gdal.py
plio/utils/log.py
+0
-2
0 additions, 2 deletions
plio/utils/log.py
with
8 additions
and
10 deletions
plio/io/io_gdal.py
+
8
−
8
View file @
5db0cb20
...
...
@@ -533,11 +533,11 @@ def match_rasters(match_to, match_from, destination,
Parameters
==========
match : object
A GeoDataSet object to be matched to
match
_to
: object
A GeoDataSet object to be matched to
source
: object
A GeoDataSet object to be clipped
match_from
: object
A GeoDataSet object to be clipped
destination : str
PATH where the output will be written
...
...
@@ -549,15 +549,15 @@ def match_rasters(match_to, match_from, destination,
GRA_Mode}
"""
# TODO: If a destination is not provided create an in-memory GeoDataSet object
match_to_srs
=
match_to
.
d
s
.
GetProjection
()
match_to_srs
=
match_to
.
d
ataset
.
GetProjection
()
match_to_gt
=
match_to
.
geotransform
width
,
height
=
match_to
.
rastersize
width
,
height
=
match_to
.
raster
_
size
match_from__srs
=
match_from
.
d
s
.
GetProjection
()
match_from__srs
=
match_from
.
d
ataset
.
GetProjection
()
match_from__gt
=
match_from
.
geotransform
dst
=
gdal
.
GetDriverByName
(
'
GTiff
'
).
Create
(
destination
,
width
,
height
,
1
,
gdalconst
.
GDT_Float32
)
dst
.
SetGeoTransform
(
match_to_gt
)
dst
.
SetProjection
(
match_to_srs
)
gdal
.
ReprojectImage
(
match_from
.
d
s
,
dst
,
None
,
None
,
getattr
(
gdalconst
,
resampling_method
))
gdal
.
ReprojectImage
(
match_from
.
d
ataset
,
dst
,
None
,
None
,
getattr
(
gdalconst
,
resampling_method
))
This diff is collapsed.
Click to expand it.
plio/utils/log.py
+
0
−
2
View file @
5db0cb20
...
...
@@ -24,9 +24,7 @@ def setup_logging(path=get_path('logging.json'),
if
value
:
path
=
value
print
(
level
)
level
=
getattr
(
logging
,
level
.
upper
())
print
(
level
)
if
os
.
path
.
exists
(
path
):
logtype
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
path
))[
1
]
with
open
(
path
,
'
rt
'
)
as
f
:
...
...
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