Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
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
Benjamin Jakimow
EO Time Series Viewer
Commits
73da4329
Commit
73da4329
authored
8 years ago
by
benjamin.jakimow@geo.hu-berlin.de
Browse files
Options
Downloads
Patches
Plain Diff
VRT_SHARED_SOURCE=0 to not crash when loading massive number of VRTs
parent
46e16462
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
timeseriesviewer/timeseries.py
+9
-4
9 additions, 4 deletions
timeseriesviewer/timeseries.py
with
9 additions
and
4 deletions
timeseriesviewer/timeseries.py
+
9
−
4
View file @
73da4329
...
@@ -12,6 +12,8 @@ from PyQt4.QtCore import *
...
@@ -12,6 +12,8 @@ from PyQt4.QtCore import *
from
PyQt4.QtXml
import
*
from
PyQt4.QtXml
import
*
from
osgeo
import
gdal
,
ogr
from
osgeo
import
gdal
,
ogr
gdal
.
SetConfigOption
(
'
VRT_SHARED_SOURCE
'
,
'
0
'
)
#!important. really. do not change this.
import
numpy
as
np
import
numpy
as
np
from
timeseriesviewer
import
DIR_REPO
,
DIR_EXAMPLES
,
dprint
,
jp
,
findAbsolutePath
from
timeseriesviewer
import
DIR_REPO
,
DIR_EXAMPLES
,
dprint
,
jp
,
findAbsolutePath
...
@@ -187,17 +189,20 @@ def verifyInputImage(path, vrtInspection=''):
...
@@ -187,17 +189,20 @@ def verifyInputImage(path, vrtInspection=''):
if
not
os
.
path
.
exists
(
path
):
if
not
os
.
path
.
exists
(
path
):
print
(
'
{}Image does not exist:
'
.
format
(
vrtInspection
,
path
))
print
(
'
{}Image does not exist:
'
.
format
(
vrtInspection
,
path
))
return
False
return
False
ds
=
gdal
.
Open
(
path
)
ds
=
gdal
.
Open
(
path
)
if
not
ds
:
if
not
ds
:
print
(
'
{}GDAL unable to open:
'
.
format
(
vrtInspection
,
path
))
print
(
'
{}GDAL unable to open:
'
.
format
(
vrtInspection
,
path
))
return
False
return
False
if
ds
.
GetDriver
().
ShortName
==
'
VRT
'
:
if
ds
.
GetDriver
().
ShortName
==
'
VRT
'
:
vrtInspection
=
'
VRT Inspection {}
\n
'
.
format
(
path
)
vrtInspection
=
'
VRT Inspection {}
\n
'
.
format
(
path
)
validSrc
=
[
verifyInputImage
(
p
,
vrtInspection
=
vrtInspection
)
for
p
in
set
(
ds
.
GetFileList
())
-
set
([
path
])]
nextFiles
=
set
(
ds
.
GetFileList
())
-
set
([
path
])
validSrc
=
[
verifyInputImage
(
p
,
vrtInspection
=
vrtInspection
)
for
p
in
nextFiles
]
if
not
all
(
validSrc
):
if
not
all
(
validSrc
):
return
False
return
False
else
:
return
True
return
True
def
pixel2coord
(
gt
,
x
,
y
):
def
pixel2coord
(
gt
,
x
,
y
):
"""
Returns global coordinates from pixel x, y coords
"""
"""
Returns global coordinates from pixel x, y coords
"""
...
@@ -220,7 +225,7 @@ class TimeSeriesDatum(QObject):
...
@@ -220,7 +225,7 @@ class TimeSeriesDatum(QObject):
if
verifyInputImage
(
p
):
if
verifyInputImage
(
p
):
try
:
try
:
tsd
=
TimeSeriesDatum
(
None
,
p
)
tsd
=
TimeSeriesDatum
(
None
,
p
)
except
:
except
:
pass
pass
...
...
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