cul_scv_hydra 0.22.4 → 0.22.5

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
  SHA1:
3
- metadata.gz: d6a57f9a4a7917ae647e29a986a83dd7f794963c
4
- data.tar.gz: 109faf64878014a8926d63ea65e849933b5259e9
3
+ metadata.gz: 0456606d41eceb5a2834e43fc5c24a2ee0b03992
4
+ data.tar.gz: 6885595ffe4cbad3e6b3220f9c8044e5d026a1f4
5
5
  SHA512:
6
- metadata.gz: c82aecc63e1c174b62ef352d4f2e802169d4b8cdc18756ca02652a1572357d2f0c3de7bcdcf09a1865709b56190e1f8405fd91938e53a2de3e80666ad35bb0c5
7
- data.tar.gz: 286fe512649eb1ddc3efc6282eb614788a09cf77f99ed42d203138e6065d7c9ef516d701017cb6593132b36b696b6d6408dcfb4c86fd868cc285d340682927f2
6
+ metadata.gz: bbecbed565f8eba222635461e0d95c29c8d9574d7f6253357d8983794a85001884c76b20fdf2ee278f75ce7ca3441a8da0f8c4da0864a71d3811865ce6c96916
7
+ data.tar.gz: a410c15c58a474dea420c940c9e5e5d1235f76f0ef5ec5107d2c12bf4462eee379a9b20202f651153fadb8a011867eb0a56f1a1a58c1f7a6c6142de62ab93aaf
@@ -277,6 +277,17 @@ module Cul::Scv::Hydra::Solrizer
277
277
  return (places_without_uri.length > 0 ? places_without_uri : places_with_uri)
278
278
  end
279
279
 
280
+ def coordinates(node=mods)
281
+ coordinate_values = []
282
+ node.xpath("./mods:subject/mods:cartographics/mods:coordinates", MODS_NS).collect do |n|
283
+ n = ScvModsFieldable.normalize(n.text, true)
284
+ if n.match(/-*\d+\.\d+\s*,\s*-*\d+\.\d+\s*/) # Expected coordinate format: 40.123456,-73.5678
285
+ coordinate_values << n
286
+ end
287
+ end
288
+ coordinate_values
289
+ end
290
+
280
291
  def to_solr(solr_doc={})
281
292
  solr_doc = (defined? super) ? super : solr_doc
282
293
 
@@ -375,6 +386,9 @@ module Cul::Scv::Hydra::Solrizer
375
386
  end
376
387
  end
377
388
 
389
+ # Geo data
390
+ solr_doc["geo"] = coordinates
391
+
378
392
  solr_doc.each do |k, v|
379
393
  if self.class.maps_field? k
380
394
  solr_doc[k] = self.class.map_value(k, v)
@@ -2,7 +2,7 @@
2
2
  module Cul
3
3
  module Scv
4
4
  module Hydra
5
- VERSION = '0.22.4'
5
+ VERSION = '0.22.5'
6
6
  def self.version
7
7
  VERSION
8
8
  end
@@ -2,7 +2,7 @@
2
2
  module Cul
3
3
  module Scv
4
4
  module Hydra
5
- VERSION = '0.22.3'
5
+ VERSION = '0.22.4'
6
6
  def self.version
7
7
  VERSION
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cul_scv_hydra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.4
4
+ version: 0.22.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Armintor
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-01 00:00:00.000000000 Z
12
+ date: 2015-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight