cocina_display 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb0bba4d19bc1aa9c9e50e75595491b54fb0fe615947305cd46d7a31c176c12c
|
|
4
|
+
data.tar.gz: 813afddbd4c11d0ac2fe76ec4f8167b27478b448924fae48dc5c59e4350c0035
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68fc4be5a58b31b54798ecfdde47395bd3984ac2950d80ed8b089beae7a800947a729daca42627411fe4d32218b6b96dbf3899bea6584c5de649454e147ed345
|
|
7
|
+
data.tar.gz: 7bdc1bfe6c7050175cdd7b1ffa44640f636f2868238b2702bb9298b4ac0d6422867b8d1eb04a845f91d228770897cc3072b04abf112cdb8c592a6aefa3f555b5
|
|
@@ -30,11 +30,11 @@ module CocinaDisplay
|
|
|
30
30
|
coordinate_objects.map(&:as_envelope).compact.uniq
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
# All valid coordinate data formatted for indexing into a Solr
|
|
33
|
+
# All valid coordinate data formatted for indexing into a Solr RPT field.
|
|
34
34
|
# @note Bounding boxes are automatically converted to their center point.
|
|
35
35
|
# @see https://solr.apache.org/guide/solr/latest/query-guide/spatial-search.html#indexing-points
|
|
36
36
|
# @return [Array<String>]
|
|
37
|
-
# @example ["34.0522
|
|
37
|
+
# @example ["-118.2437 34.0522"]
|
|
38
38
|
def coordinates_as_point
|
|
39
39
|
coordinate_objects.map(&:as_point).uniq
|
|
40
40
|
end
|
|
@@ -407,6 +407,8 @@ module CocinaDisplay
|
|
|
407
407
|
return nil if date.nil?
|
|
408
408
|
|
|
409
409
|
case date_range
|
|
410
|
+
when EDTF::Unknown
|
|
411
|
+
nil
|
|
410
412
|
when EDTF::Epoch, EDTF::Interval, EDTF::Season
|
|
411
413
|
date_range.min
|
|
412
414
|
when EDTF::Set
|
|
@@ -427,6 +429,8 @@ module CocinaDisplay
|
|
|
427
429
|
return nil if date.nil?
|
|
428
430
|
|
|
429
431
|
case date_range
|
|
432
|
+
when EDTF::Unknown
|
|
433
|
+
nil
|
|
430
434
|
when EDTF::Epoch, EDTF::Interval, EDTF::Season
|
|
431
435
|
date_range.max
|
|
432
436
|
when EDTF::Set
|
|
@@ -130,12 +130,12 @@ module CocinaDisplay
|
|
|
130
130
|
nil
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
-
# Format as a
|
|
133
|
+
# Format as a space-separated x y (longitude latitude) pair.
|
|
134
134
|
# @note Limits decimals to 6 places.
|
|
135
|
-
# @example "34.0522
|
|
135
|
+
# @example "-118.2437 34.0522"
|
|
136
136
|
# @return [String]
|
|
137
137
|
def as_point
|
|
138
|
-
"%.6f
|
|
138
|
+
"%.6f %.6f" % [point.lng, point.lat]
|
|
139
139
|
end
|
|
140
140
|
end
|
|
141
141
|
|
|
@@ -205,15 +205,15 @@ module CocinaDisplay
|
|
|
205
205
|
]
|
|
206
206
|
end
|
|
207
207
|
|
|
208
|
-
# The box center point as a
|
|
208
|
+
# The box center point as a space-separated x y (longitude latitude) pair.
|
|
209
209
|
# @note Limits decimals to 6 places.
|
|
210
|
-
# @example "34.0522
|
|
210
|
+
# @example "-118.2437 34.0522"
|
|
211
211
|
# @return [String]
|
|
212
212
|
def as_point
|
|
213
213
|
azimuth = min_point.azimuth(max_point)
|
|
214
214
|
distance = min_point.distance(max_point)
|
|
215
215
|
center = min_point.endpoint(distance / 2, azimuth)
|
|
216
|
-
"%.6f
|
|
216
|
+
"%.6f %.6f" % [center.lng, center.lat]
|
|
217
217
|
end
|
|
218
218
|
end
|
|
219
219
|
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cocina_display
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.8.
|
|
4
|
+
version: 1.8.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Budak
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: janeway-jsonpath
|
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
298
298
|
- !ruby/object:Gem::Version
|
|
299
299
|
version: '0'
|
|
300
300
|
requirements: []
|
|
301
|
-
rubygems_version: 3.6.
|
|
301
|
+
rubygems_version: 3.6.9
|
|
302
302
|
specification_version: 4
|
|
303
303
|
summary: Helpers for rendering Cocina metadata
|
|
304
304
|
test_files: []
|