sentinel_s3 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -1
- data/lib/sentinel_s3/client.rb +12 -0
- data/lib/sentinel_s3/version.rb +1 -1
- data/sentinel_s3.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbc5433bf2015598e89031948bb98aa53884880bf68481ca8375fd61f595a47c
|
4
|
+
data.tar.gz: 00db77b48db11a9b0836e695e26014d96ea918e3364ae3c94ee18f16fb936cdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2bd2e22d0c38becfad49b50590cec299793a1a1a167f9c1ffd0edb2ef086c1014e8cd9ce5fae4f96eb6e3a25f1fbe33b2de81e4429a386b016f914f63839b76
|
7
|
+
data.tar.gz: da97183db1507f808a73742e7e06855ec1ae900bb7af1405e8ee47108ca480a3c9fb89945072221a9e3c35b0b9425ebcd3803d22f9e71f665ac04119f13295f6
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# sentinel_s3
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/sentinel_s3.svg)][gem]
|
4
|
+
|
5
|
+
[gem]: https://rubygems.org/gems/sentinel_s3
|
6
|
+
|
7
|
+
Ruby library for extracting Sentinel-2 tile metadata and downloading tile data from [Amazon S3](https://aws.amazon.com/public-datasets/sentinel-2/).
|
4
8
|
This was created to be the primary mechanism for inserting data into the [Sentinel-2 S3 Search API](https://github.com/beaorn/s2) project.
|
5
9
|
|
6
10
|
## Installation
|
@@ -65,6 +69,11 @@ metadata = client.get_product_info(product)
|
|
65
69
|
}
|
66
70
|
```
|
67
71
|
|
72
|
+
Download tile data `download_tile_data(s3 tile path, file, output path)`
|
73
|
+
```ruby
|
74
|
+
client.download_tile_data("tiles/57/M/VR/2017/12/15/0", "B01.jp2", "/path/that/exists")
|
75
|
+
```
|
76
|
+
|
68
77
|
## Development
|
69
78
|
|
70
79
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/sentinel_s3/client.rb
CHANGED
@@ -106,6 +106,18 @@ module SentinelS3
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
+
def download_tile_data(tile_path, filename, output_path)
|
110
|
+
s3_file = "#{tile_path}/#{filename}"
|
111
|
+
if @s3_resource.bucket(S3_BUCKET).object(s3_file).exists?
|
112
|
+
filepath = "#{output_path}/#{filename}"
|
113
|
+
obj = @s3_resource.bucket(S3_BUCKET).object(s3_file)
|
114
|
+
obj.get(response_target: filepath)
|
115
|
+
return filepath
|
116
|
+
else
|
117
|
+
return nil
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
109
121
|
def remove_directory
|
110
122
|
FileUtils.remove_dir(@directory)
|
111
123
|
end
|
data/lib/sentinel_s3/version.rb
CHANGED
data/sentinel_s3.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Bryce Johnston"]
|
10
10
|
spec.email = ["bryce@agdeveloper.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{Sentinel-2 metadata
|
13
|
-
spec.description = %q{Sentinel-2 metadata
|
12
|
+
spec.summary = %q{Sentinel-2 metadata extractor and tile data downloader from Amazon S3}
|
13
|
+
spec.description = %q{Sentinel-2 metadata extractor and tile data downloader from Amazon S3}
|
14
14
|
spec.homepage = "https://github.com/beaorn/sentinel_s3"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentinel_s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryce Johnston
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.0'
|
83
|
-
description: Sentinel-2 metadata
|
83
|
+
description: Sentinel-2 metadata extractor and tile data downloader from Amazon S3
|
84
84
|
email:
|
85
85
|
- bryce@agdeveloper.com
|
86
86
|
executables: []
|
@@ -124,5 +124,5 @@ rubyforge_project:
|
|
124
124
|
rubygems_version: 2.7.3
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
|
-
summary: Sentinel-2 metadata
|
127
|
+
summary: Sentinel-2 metadata extractor and tile data downloader from Amazon S3
|
128
128
|
test_files: []
|