Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (4)
New upstream version 1.0.15
· d6b754d4
Bas Couwenberg
authored
Jan 28, 2019
d6b754d4
Merge tag 'upstream/1.0.15'
· ca3eb8e1
Bas Couwenberg
authored
Jan 28, 2019
Upstream version 1.0.15
ca3eb8e1
New upstream release.
· ac3943d9
Bas Couwenberg
authored
Jan 28, 2019
ac3943d9
Set distribution to unstable.
· 13c9e64d
Bas Couwenberg
authored
Jan 28, 2019
13c9e64d
Show whitespace changes
Inline
Side-by-side
AUTHORS.txt
View file @
13c9e64d
...
...
@@ -68,4 +68,4 @@ Authors
* Vincent Schut
* Alan D.
* grovduck
* Dan Little
* Dan
"Ducky"
Little
CHANGES.txt
View file @
13c9e64d
Changes
=======
1.0.15 (2019-01-27)
-------------------
- Google cloud storage support was *not* in fact added in 1.0.14, but is
present in 1.0.15.
1.0.14 (2019-01-22)
-------------------
...
...
debian/changelog
View file @
13c9e64d
rasterio (1.0.15-1) unstable; urgency=medium
* Team upload.
* New upstream release.
-- Bas Couwenberg <sebastic@debian.org> Mon, 28 Jan 2019 07:21:11 +0100
rasterio (1.0.14-1) unstable; urgency=medium
* Team upload.
...
...
rasterio/__init__.py
View file @
13c9e64d
...
...
@@ -42,7 +42,7 @@ import rasterio.path
__all__
=
[
'
band
'
,
'
open
'
,
'
pad
'
,
'
Env
'
]
__version__
=
"
1.0.1
4
"
__version__
=
"
1.0.1
5
"
__gdal_version__
=
gdal_version
()
# Rasterio attaches NullHandler to the 'rasterio' logger and its
...
...
rasterio/_crs.pyx
View file @
13c9e64d
...
...
@@ -114,9 +114,12 @@ cdef class _CRS(object):
exc_wrap_ogrerr
(
OSRMorphFromESRI
(
osr
))
if
OSRAutoIdentifyEPSG
(
osr
)
==
0
:
epsg_code
=
OSRGetAuthorityCode
(
osr
,
NULL
)
if
epsg_code
!=
NULL
:
return
int
(
epsg_code
.
decode
(
'
utf-8
'
))
else
:
return
None
else
:
return
None
finally
:
_safe_osr_release
(
osr
)
...
...
rasterio/path.py
View file @
13c9e64d
...
...
@@ -18,13 +18,14 @@ SCHEMES = {
'
tar
'
:
'
tar
'
,
'
zip
'
:
'
zip
'
,
'
file
'
:
'
file
'
,
'
oss
'
:
'
oss
'
'
oss
'
:
'
oss
'
,
'
gs
'
:
'
gs
'
,
}
CURLSCHEMES
=
set
([
k
for
k
,
v
in
SCHEMES
.
items
()
if
v
==
'
curl
'
])
# TODO: extend for other cloud plaforms.
REMOTESCHEMES
=
set
([
k
for
k
,
v
in
SCHEMES
.
items
()
if
v
in
(
'
curl
'
,
'
s3
'
,
'
oss
'
)])
REMOTESCHEMES
=
set
([
k
for
k
,
v
in
SCHEMES
.
items
()
if
v
in
(
'
curl
'
,
'
s3
'
,
'
oss
'
,
'
gs
'
)])
class
Path
(
object
):
...
...
rasterio/rio/info.py
View file @
13c9e64d
...
...
@@ -92,8 +92,8 @@ def info(ctx, input, aspect, indent, namespace, meta_member, verbose, bidx,
if
gcps
:
info
[
'
gcps
'
]
=
{
'
points
'
:
[
p
.
asdict
()
for
p
in
gcps
]}
if
crs
:
epsg
=
crs
.
to_epsg
()
if
gcps_
crs
:
epsg
=
gcps_
crs
.
to_epsg
()
if
epsg
:
info
[
'
gcps
'
][
'
crs
'
]
=
'
EPSG:{}
'
.
format
(
epsg
)
else
:
...
...
rasterio/session.py
View file @
13c9e64d
...
...
@@ -318,4 +318,51 @@ class OSSSession(Session):
return
{
k
.
upper
():
v
for
k
,
v
in
self
.
credentials
.
items
()}
class
GSSession
(
Session
):
"""
Configures access to secured resources stored in Google Cloud Storage
"""
def
__init__
(
self
,
google_application_credentials
=
None
):
"""
Create new Google Cloude Storage session
Parameters
----------
google_application_credentials: string
Path to the google application credentials JSON file.
"""
self
.
_creds
=
{}
if
google_application_credentials
is
not
None
:
self
.
_creds
[
'
google_application_credentials
'
]
=
google_application_credentials
@classmethod
def
hascreds
(
cls
,
config
):
"""
Determine if the given configuration has proper credentials
Parameters
----------
cls : class
A Session class.
config : dict
GDAL configuration as a dict.
Returns
-------
bool
"""
return
'
GOOGLE_APPLICATION_CREDENTIALS
'
in
config
@property
def
credentials
(
self
):
"""
The session credentials as a dict
"""
return
self
.
_creds
def
get_credential_options
(
self
):
"""
Get credentials as GDAL configuration options
Returns
-------
dict
"""
return
{
k
.
upper
():
v
for
k
,
v
in
self
.
credentials
.
items
()}
tests/test_session.py
View file @
13c9e64d
...
...
@@ -2,7 +2,7 @@
import
pytest
from
rasterio.session
import
DummySession
,
AWSSession
,
Session
,
OSSSession
from
rasterio.session
import
DummySession
,
AWSSession
,
Session
,
OSSSession
,
GSSession
def
test_dummy_session
():
...
...
@@ -133,3 +133,10 @@ def test_session_factory_oss_kwargs():
assert
isinstance
(
sesh
,
OSSSession
)
assert
sesh
.
get_credential_options
()[
'
OSS_ACCESS_KEY_ID
'
]
==
'
foo
'
assert
sesh
.
get_credential_options
()[
'
OSS_SECRET_ACCESS_KEY
'
]
==
'
bar
'
def
test_gs_session_class
():
"""
GSSession works
"""
gs_session
=
GSSession
(
google_application_credentials
=
'
foo
'
)
assert
gs_session
.
_creds
assert
gs_session
.
get_credential_options
()[
'
GOOGLE_APPLICATION_CREDENTIALS
'
]
==
'
foo
'