geo_combine 0.0.2 → 0.0.3
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 +4 -4
- data/README.md +7 -0
- data/lib/geo_combine/fgdc.rb +9 -2
- data/lib/geo_combine/iso19139.rb +9 -2
- data/lib/geo_combine/version.rb +1 -1
- data/lib/geo_combine.rb +10 -2
- data/lib/xslt/fgdc2html.xsl +1034 -0
- data/lib/xslt/iso2html.xsl +1745 -0
- data/lib/xslt/utils/convert-enumerations.xsl +97 -0
- data/lib/xslt/utils/convert-latlong.xsl +73 -0
- data/lib/xslt/utils/decode-uri/base.css +408 -0
- data/lib/xslt/utils/decode-uri/index.html +29 -0
- data/lib/xslt/utils/elements-fgdc.xml +824 -0
- data/lib/xslt/utils/elements-iso.xml +636 -0
- data/lib/xslt/utils/printFormatted.xsl +267 -0
- data/lib/xslt/utils/printTextLines.xsl +192 -0
- data/lib/xslt/utils/replace-newlines.xsl +97 -0
- data/lib/xslt/utils/replace-string.xsl +80 -0
- data/lib/xslt/utils/strip-digits.xsl +60 -0
- data/lib/xslt/utils/url-decode.xsl +87 -0
- data/lib/xslt/utils/wrap-text.xsl +174 -0
- data/spec/lib/geo_combine/fgdc_spec.rb +12 -2
- data/spec/lib/geo_combine/iso19139_spec.rb +12 -2
- data/spec/lib/geo_combine_spec.rb +2 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5783dffed9a83f91f83260196363a9a0d8913f88
|
4
|
+
data.tar.gz: e12b7305ad32f141e5a98543f6c908a95ee7d483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bf4f267d66ce5a491854a25dc3909b8ac9d00398e0e99fcadfb03eecf5c79370fcc76a55791565729a75d499beadc03c3ce530a8fbe09af551c3b7665658035
|
7
|
+
data.tar.gz: 44bcd08fda5b8206cf8ab073dfcf46b6faf4394dfb1c74b8a90c4c6699a12c9601311146dbc6ca15a2a3c74ada652094556803795d112a702fb0a13bf0d4a86b
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# GeoCombine
|
2
2
|
|
3
|
+
[](https://travis-ci.org/OpenGeoMetadata/GeoCombine) | [](https://coveralls.io/r/OpenGeoMetadata/GeoCombine?branch=master)
|
4
|
+
|
5
|
+
|
6
|
+
|
3
7
|
A Ruby toolkit for managing geospatial metadata
|
4
8
|
|
5
9
|
## Installation
|
@@ -32,6 +36,9 @@ GeoCombine can be used as a set of rake tasks for cloning, updating, and indexin
|
|
32
36
|
|
33
37
|
# Convert that to JSON
|
34
38
|
> iso_metadata.to_geoblacklight.to_json
|
39
|
+
|
40
|
+
# Convert ISO or FGDC to HTML
|
41
|
+
> iso_metadata.to_html
|
35
42
|
```
|
36
43
|
|
37
44
|
### Clone all OpenGeoMetadata repositories
|
data/lib/geo_combine/fgdc.rb
CHANGED
@@ -6,9 +6,16 @@ module GeoCombine
|
|
6
6
|
|
7
7
|
##
|
8
8
|
# Returns a Nokogiri::XSLT object containing the FGDC to GeoBlacklight XSL
|
9
|
-
# @return
|
10
|
-
def
|
9
|
+
# @return [Nokogiri::XSLT]
|
10
|
+
def xsl_geoblacklight
|
11
11
|
Nokogiri::XSLT(File.read('./lib/xslt/fgdc2geoBL.xsl'))
|
12
12
|
end
|
13
|
+
|
14
|
+
##
|
15
|
+
# Returns a Nokogiri::XSLT object containing the ISO19139 to HTML XSL
|
16
|
+
# @return [Nokogiri:XSLT]
|
17
|
+
def xsl_html
|
18
|
+
Nokogiri::XSLT(File.read('./lib/xslt/fgdc2html.xsl'))
|
19
|
+
end
|
13
20
|
end
|
14
21
|
end
|
data/lib/geo_combine/iso19139.rb
CHANGED
@@ -4,9 +4,16 @@ module GeoCombine
|
|
4
4
|
##
|
5
5
|
# Returns a Nokogiri::XSLT object containing the ISO19139 to GeoBlacklight
|
6
6
|
# XSL
|
7
|
-
# @return
|
8
|
-
def
|
7
|
+
# @return [Nokogiri::XSLT]
|
8
|
+
def xsl_geoblacklight
|
9
9
|
Nokogiri::XSLT(File.read('./lib/xslt/iso2geoBL.xsl'))
|
10
10
|
end
|
11
|
+
|
12
|
+
##
|
13
|
+
# Returns a Nokogiri::XSLT object containing the ISO19139 to HTML XSL
|
14
|
+
# @return [Nokogiri:XSLT]
|
15
|
+
def xsl_html
|
16
|
+
Nokogiri::XSLT(File.read('./lib/xslt/iso2html.xsl'))
|
17
|
+
end
|
11
18
|
end
|
12
19
|
end
|
data/lib/geo_combine/version.rb
CHANGED
data/lib/geo_combine.rb
CHANGED
@@ -17,7 +17,7 @@ module GeoCombine
|
|
17
17
|
##
|
18
18
|
# Creates a new GeoCombine::Metadata object, where metadata parameter is can
|
19
19
|
# be a File path or String of XML
|
20
|
-
# @param
|
20
|
+
# @param [String] metadata can be a File path
|
21
21
|
# "./tmp/edu.stanford.purl/bb/338/jh/0716/iso19139.xml" or a String of XML
|
22
22
|
# metadata
|
23
23
|
def initialize metadata
|
@@ -28,8 +28,16 @@ module GeoCombine
|
|
28
28
|
|
29
29
|
##
|
30
30
|
# Perform an XSLT tranformation on metadata using an object's XSL
|
31
|
+
# @return [GeoCombine::Geoblacklight] the data transformed into geoblacklight schema, returned as a GeoCombine::Geoblacklight
|
31
32
|
def to_geoblacklight
|
32
|
-
GeoCombine::Geoblacklight.new(
|
33
|
+
GeoCombine::Geoblacklight.new(xsl_geoblacklight.transform(@metadata))
|
34
|
+
end
|
35
|
+
|
36
|
+
##
|
37
|
+
# Perform an XSLT transformation to HTML using an object's XSL
|
38
|
+
# @return [String] the xml transformed to an HTML String
|
39
|
+
def to_html
|
40
|
+
xsl_html.transform(@metadata).to_html
|
33
41
|
end
|
34
42
|
end
|
35
43
|
end
|