Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
geoarray
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Daniel Scheffler
geoarray
Commits
3eefe7d1
Commit
3eefe7d1
authored
Aug 08, 2018
by
Daniel Scheffler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed metadata setter. Removed deprecated code.
parent
b9b19c2a
Pipeline
#3074
failed with stages
in 1 minute and 20 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
17 deletions
+6
-17
geoarray/baseclasses.py
geoarray/baseclasses.py
+6
-5
geoarray/metadata.py
geoarray/metadata.py
+0
-12
No files found.
geoarray/baseclasses.py
View file @
3eefe7d1
...
...
@@ -516,11 +516,12 @@ class GeoArray(object):
return
self
.
_metadata
@
metadata
.
setter
def
metadata
(
self
,
GDF
):
assert
isinstance
(
GDF
,
(
GeoDataFrame
,
DataFrame
))
and
len
(
GDF
.
columns
)
==
self
.
bands
,
\
"%s.metadata can only be set with an instance of geopandas.GeoDataFrame of which the column number "
\
"corresponds to the band number of %s."
%
(
self
.
__class__
.
__name__
,
self
.
__class__
.
__name__
)
self
.
_metadata
=
GDF
def
metadata
(
self
,
meta
):
if
not
isinstance
(
meta
,
GDAL_Metadata
)
or
meta
.
bands
!=
self
.
bands
:
raise
ValueError
(
"%s.metadata can only be set with an instance of geoarray.metadata.GDAL_Metadata of "
"which the band number corresponds to the band number of %s."
%
(
self
.
__class__
.
__name__
,
self
.
__class__
.
__name__
))
self
.
_metadata
=
meta
meta
=
alias_property
(
'metadata'
)
...
...
geoarray/metadata.py
View file @
3eefe7d1
...
...
@@ -43,18 +43,6 @@ class GDAL_Metadata(object):
def
from_file
(
cls
,
filePath
):
return
GDAL_Metadata
(
filePath
=
filePath
)
@
classmethod
def
from_DataFrame
(
cls
,
dataframe
):
# type: (GeoDataFrame) -> 'GDAL_Metadata'
if
dataframe
.
empty
:
raise
ValueError
(
'DataFame must not be empty.'
)
GDMD
=
GDAL_Metadata
(
nbands
=
dataframe
.
shape
[
1
])
GDMD
.
df
=
dataframe
return
GDMD
def
to_DataFrame
(
self
):
df
=
GeoDataFrame
(
columns
=
range
(
self
.
bands
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment