geoserver-publish 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/lib/geoserver/publish/coverage_store.rb +35 -0
- data/lib/geoserver/publish/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9db10b46d41ef044f7527b82aed3465f85382d743a04bc5fa1d6ada89cc848d
|
4
|
+
data.tar.gz: 8143a50b59ab0e9fbfa3d77fa0332bafcda2db79b70121dd01ebd3d6e081ab67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f2e5bc90e55b89bae11f1c577bbb0e95997425b7ab977035d0a1f9fd47f9bb64b944fb2c3c6be8559b2da9b222930839ed52dd45da0a5176fbef28029b4a800
|
7
|
+
data.tar.gz: e59bc180f9764ef886f2f58bc4a440d617a4758ada9c518265c06d53196607ff58784b408944c75245772cea2a766fdf0ddc1cfd2c49cd04615df2058fba0dfb
|
data/.rubocop.yml
CHANGED
@@ -2,7 +2,7 @@ inherit_gem:
|
|
2
2
|
bixby: bixby_default.yml
|
3
3
|
AllCops:
|
4
4
|
DisplayCopNames: true
|
5
|
-
TargetRubyVersion: 2.
|
5
|
+
TargetRubyVersion: 2.7
|
6
6
|
Exclude:
|
7
7
|
- 'bin/*'
|
8
8
|
Lint/UnusedMethodArgument:
|
@@ -13,7 +13,7 @@ Metrics/BlockLength:
|
|
13
13
|
- "spec/**/*"
|
14
14
|
- "*.gemspec"
|
15
15
|
Naming/FileName:
|
16
|
-
Exclude:
|
16
|
+
Exclude:
|
17
17
|
- "geoserver-publish.gemspec"
|
18
18
|
- "Gemfile"
|
19
19
|
Style/StringLiterals:
|
@@ -31,6 +31,35 @@ module Geoserver
|
|
31
31
|
connection.put(path: path, payload: payload, content_type: "application/json")
|
32
32
|
end
|
33
33
|
|
34
|
+
##
|
35
|
+
# Upload raster data files to a new coverage store
|
36
|
+
# # @param workspace_name [String]
|
37
|
+
# # @param coverage_store_name [String]
|
38
|
+
# # @param format [String] One of:
|
39
|
+
# geotiff == GeoTIFF
|
40
|
+
# worldimage == Georeferenced image (JPEG, PNG, TIFF)
|
41
|
+
# imagemosaic == Image mosaic
|
42
|
+
# See: https://docs.geoserver.org/stable/en/user/rest/api/coveragestores.html#extension
|
43
|
+
# # @param file [String] Depending on value of method:
|
44
|
+
# file == binary stream
|
45
|
+
# url == URL to publicly available raster files (DOESN'T ACTUALLY WORK).
|
46
|
+
# external == absolute path to existing file
|
47
|
+
# # @param content_type [String] Content-Type for file upload
|
48
|
+
# # @param method [String] Can be one of 'file', 'url', 'external'.
|
49
|
+
# See: https://docs.geoserver.org/latest/en/api/#1.0.0/coveragestores.yaml
|
50
|
+
# rubocop:disable Metrics/ParameterLists
|
51
|
+
def upload(workspace_name:, coverage_store_name:, format:, file:, method: "file", content_type: "application/zip")
|
52
|
+
path = upload_url(
|
53
|
+
workspace_name: workspace_name,
|
54
|
+
coverage_store_name: coverage_store_name,
|
55
|
+
method: method,
|
56
|
+
format: format
|
57
|
+
)
|
58
|
+
|
59
|
+
connection.put(path: path, payload: file, content_type: content_type)
|
60
|
+
end
|
61
|
+
# rubocop:enable Metrics/ParameterLists
|
62
|
+
|
34
63
|
private
|
35
64
|
|
36
65
|
def coverage_store_url(workspace_name:, coverage_store_name:)
|
@@ -38,6 +67,12 @@ module Geoserver
|
|
38
67
|
"workspaces/#{workspace_name}/coveragestores#{last_path_component}"
|
39
68
|
end
|
40
69
|
|
70
|
+
# see: https://docs.geoserver.org/latest/en/api/#1.0.0/coveragestores.yaml
|
71
|
+
# /workspaces/{workspace}/coveragestores/{store}/{method}.{format}
|
72
|
+
def upload_url(workspace_name:, coverage_store_name:, method:, format:)
|
73
|
+
"workspaces/#{workspace_name}/coveragestores/#{coverage_store_name}/#{method}.#{format}?coverageName=#{coverage_store_name}"
|
74
|
+
end
|
75
|
+
|
41
76
|
def payload_new(workspace_name:, coverage_store_name:, type:, url:, payload:)
|
42
77
|
{
|
43
78
|
coverageStore: {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geoserver-publish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eliot Jordan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|