geoloader 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +13 -0
- data/.gitignore +17 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +2 -0
- data/README.md +212 -0
- data/Rakefile +10 -0
- data/bin/geoloader +4 -0
- data/config.yaml +18 -0
- data/geoloader.gemspec +37 -0
- data/iso19139.xsl +445 -0
- data/lib/geoloader.rb +48 -0
- data/lib/geoloader/assets/asset.rb +63 -0
- data/lib/geoloader/assets/description.rb +55 -0
- data/lib/geoloader/assets/geonetwork.rb +58 -0
- data/lib/geoloader/assets/geotiff.rb +41 -0
- data/lib/geoloader/assets/shapefile.rb +28 -0
- data/lib/geoloader/assets/solr.rb +23 -0
- data/lib/geoloader/cli/app.rb +26 -0
- data/lib/geoloader/cli/geonetwork.rb +36 -0
- data/lib/geoloader/cli/geoserver.rb +36 -0
- data/lib/geoloader/cli/solr.rb +36 -0
- data/lib/geoloader/loaders/geonetwork.rb +40 -0
- data/lib/geoloader/loaders/geotiff_geoserver.rb +47 -0
- data/lib/geoloader/loaders/geotiff_solr.rb +40 -0
- data/lib/geoloader/loaders/loader.rb +53 -0
- data/lib/geoloader/loaders/shapefile_geoserver.rb +40 -0
- data/lib/geoloader/loaders/shapefile_solr.rb +40 -0
- data/lib/geoloader/services/geonetwork.rb +201 -0
- data/lib/geoloader/services/geoserver.rb +104 -0
- data/lib/geoloader/services/solr.rb +62 -0
- data/lib/geoloader/tasks/geonetwork.rb +28 -0
- data/lib/geoloader/tasks/geoserver.rb +19 -0
- data/lib/geoloader/tasks/solr.rb +19 -0
- data/lib/geoloader/version.rb +4 -0
- data/metadata.md +13 -0
- data/spec/fixtures/geotiff.tfw +6 -0
- data/spec/fixtures/geotiff.tif +0 -0
- data/spec/fixtures/geotiff.tif.aux.xml +1315 -0
- data/spec/fixtures/geotiff.tif.ovr +0 -0
- data/spec/fixtures/geotiff.tif.vat.dbf +0 -0
- data/spec/fixtures/geotiff.tif.xml +2 -0
- data/spec/fixtures/shapefile.dbf +0 -0
- data/spec/fixtures/shapefile.prj +1 -0
- data/spec/fixtures/shapefile.sbn +0 -0
- data/spec/fixtures/shapefile.sbx +0 -0
- data/spec/fixtures/shapefile.shp +0 -0
- data/spec/fixtures/shapefile.shp.xml +51 -0
- data/spec/fixtures/shapefile.shx +0 -0
- data/spec/helpers/fixture.rb +13 -0
- data/spec/loaders/geonetwork.rb +38 -0
- data/spec/loaders/geotiff_geoserver.rb +49 -0
- data/spec/loaders/geotiff_solr.rb +34 -0
- data/spec/loaders/shapefile_geoserver.rb +49 -0
- data/spec/loaders/shapefile_solr.rb +34 -0
- data/spec/spec_helper.rb +6 -0
- metadata +362 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c790c4ec53a3855b0e05a6593e544d7090e3ba98
|
4
|
+
data.tar.gz: d6ff84af7358a4b2cbf610ae4e41edfe96cbe7fe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0040ed9166cba207cf7b29f83e24d1f1136e3e005ab84a008a6ce5b7c7fbeb2b99d0dcda3e71fcf56612dcc1f52c754b3809b427df9ef337888fa2a49e2392c4
|
7
|
+
data.tar.gz: da16548941b89e2e2d9324701dc49c6edb1733a723f876fce15056eabddea33eadd9a6e151bd6cb62b5260ea7e730bc3e42194581010218a4b4a2c841a307711
|
data/.editorconfig
ADDED
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
geoloader
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,212 @@
|
|
1
|
+
# Geoloader
|
2
|
+
|
3
|
+
[![Code Climate](https://codeclimate.com/github/scholarslab/Geoloader.png)](https://codeclimate.com/github/scholarslab/Geoloader)
|
4
|
+
|
5
|
+
Geoloader automates the process of loading [GeoTIFFs][geotiff] and [Shapfiles][shapefile] into [Geoserver][geoserver], [Geonetwork][geonetwork], and [Solr][solr] (using the [OpenGeoPortal schema][ogp-schema]), the services that power the geospatial search interface at the University of Virginia Library.
|
6
|
+
|
7
|
+
## Quick Examples
|
8
|
+
|
9
|
+
#### `geoloader solr`
|
10
|
+
|
11
|
+
Load files to Solr.
|
12
|
+
|
13
|
+
```bash
|
14
|
+
# Load files matched by wildcard:
|
15
|
+
geoloader solr load /path/to/files/*
|
16
|
+
|
17
|
+
# Load an individual Geotiff:
|
18
|
+
geoloader solr load /path/to/geotiff.tif
|
19
|
+
|
20
|
+
# Load an individual Shapefile:
|
21
|
+
geoloader solr load /path/to/shapefile.sh
|
22
|
+
|
23
|
+
# Load files to a custom workspace:
|
24
|
+
geoloader solr load /path/to/files/* --workspace aerials
|
25
|
+
|
26
|
+
# Merge markdown metadata into the Solr documents:
|
27
|
+
geoloader solr load /path/to/files/* --description /path/to/markdown
|
28
|
+
|
29
|
+
# Push the jobs onto a Resque queue:
|
30
|
+
geoloader solr load /path/to/files/* --queue
|
31
|
+
|
32
|
+
# Clear all documents in a workspace:
|
33
|
+
geoloader solr clear workspace
|
34
|
+
```
|
35
|
+
|
36
|
+
#### `geoloader geoserver`
|
37
|
+
|
38
|
+
Load files to Geoserver.
|
39
|
+
|
40
|
+
```bash
|
41
|
+
# Load files matched by wildcard:
|
42
|
+
geoloader geoserver load /path/to/files/*.tif
|
43
|
+
|
44
|
+
# Load an individual Geotiff:
|
45
|
+
geoloader geoserver load /path/to/geotiff.tif
|
46
|
+
|
47
|
+
# Load an individual Shapefile:
|
48
|
+
geoloader geoserver load /path/to/shapefile.shp
|
49
|
+
|
50
|
+
# Load files to a custom workspace:
|
51
|
+
geoloader geoserver load /path/to/files/*.shp --workspace aerials
|
52
|
+
|
53
|
+
# Push the jobs onto a Resque queue:
|
54
|
+
geoloader geoserver load /path/to/files/* --queue
|
55
|
+
|
56
|
+
# Clear all documents in a workspace:
|
57
|
+
geoloader geoserver clear workspace
|
58
|
+
```
|
59
|
+
|
60
|
+
#### `geoloader geonetwork`
|
61
|
+
|
62
|
+
Load files to Geonetwork.
|
63
|
+
|
64
|
+
```bash
|
65
|
+
# Load files matched by wildcard:
|
66
|
+
geoloader geonetwork load /path/to/files/*
|
67
|
+
|
68
|
+
# Load an individual Geotiff:
|
69
|
+
geoloader geonetwork load /path/to/geotiff.tif
|
70
|
+
|
71
|
+
# Load an individual Shapefile:
|
72
|
+
geoloader geonetwork load /path/to/shapefile.sh
|
73
|
+
|
74
|
+
# Load files to a custom workspace:
|
75
|
+
geoloader geonetwork load /path/to/files/* --workspace aerials
|
76
|
+
|
77
|
+
# Merge markdown metadata into the ISO19139 records:
|
78
|
+
geoloader geonetwork load /path/to/files/* --description /path/to/markdown
|
79
|
+
|
80
|
+
# Push the jobs onto a Resque queue:
|
81
|
+
geoloader geonetwork load /path/to/files/* --queue
|
82
|
+
|
83
|
+
# Clear all documents in a workspace:
|
84
|
+
geoloader geonetwork clear workspace
|
85
|
+
```
|
86
|
+
|
87
|
+
#### Or, from ruby
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
# Load a Geotiff to Geoserver:
|
91
|
+
Geoloader::GeotiffGeoserverLoader.new("/path/to/file", "workspace", "/path/to/desc.md"}).load
|
92
|
+
|
93
|
+
# Load a Geotiff to Solr:
|
94
|
+
Geoloader::GeotiffSolrLoader.new("/path/to/file", "workspace", "/path/to/desc.md"}).load
|
95
|
+
|
96
|
+
# Load a Shapefile to Geoserver:
|
97
|
+
Geoloader::ShapefileGeotiffLoader.new("/path/to/file", "workspace", "/path/to/desc.md"}).load
|
98
|
+
|
99
|
+
# Load a Shapefile to Solr:
|
100
|
+
Geoloader::ShapefileSolrLoader.new("/path/to/file", "workspace", "/path/to/desc.md").load
|
101
|
+
|
102
|
+
# Load a Geotiff or Shapefile to Geonetwork:
|
103
|
+
Geoloader::GeonetworkLoader.new("/path/to/file", "workspace", "/path/to/desc.md").load
|
104
|
+
|
105
|
+
# Or use any of the loader classes as a Resque job:
|
106
|
+
Resque.enqueue(Geoloader::GeotiffSolrLoader, "/path/to/file", "workspace", "/path/to/desc.md")
|
107
|
+
```
|
108
|
+
|
109
|
+
## Installation and Configuration
|
110
|
+
|
111
|
+
To get started, clone the repo and install the gem:
|
112
|
+
|
113
|
+
```
|
114
|
+
rake install
|
115
|
+
```
|
116
|
+
|
117
|
+
Then, you'll need to point Geoloader at running instances of Geoserver / Solr / Geonetwork (or any combination thereof). By default, Geoloader starts by applying the configuration settings in the top-level `config.yaml` file:
|
118
|
+
|
119
|
+
```yaml
|
120
|
+
workspaces:
|
121
|
+
production: geoloader
|
122
|
+
testing: geoloader_test
|
123
|
+
|
124
|
+
solr:
|
125
|
+
url: http://localhost:8080/solr/geoloader
|
126
|
+
|
127
|
+
geoserver:
|
128
|
+
url: http://localhost:8080/geoserver
|
129
|
+
username: admin
|
130
|
+
password: geoserver
|
131
|
+
srs: EPSG:3857
|
132
|
+
|
133
|
+
geonetwork:
|
134
|
+
url: http://localhost:8080/geonetwork/srv/en
|
135
|
+
username: admin
|
136
|
+
password: admin
|
137
|
+
group: geoloader
|
138
|
+
```
|
139
|
+
|
140
|
+
Depending on your needs, you can override some or all of these settings. For example, you'll almost always need to set custom credentials for Geoserver.
|
141
|
+
|
142
|
+
#### Ruby
|
143
|
+
|
144
|
+
If you're using Geoloader programmatically in code, pass any hash-like object to the `configure` method on the `Geoloader` module to set configuration options directly:
|
145
|
+
|
146
|
+
```ruby
|
147
|
+
require "geoloader"
|
148
|
+
|
149
|
+
Geoloader.configure({
|
150
|
+
:geoserver => {
|
151
|
+
:username => "gs_username",
|
152
|
+
:username => "gs_password"
|
153
|
+
}
|
154
|
+
})
|
155
|
+
```
|
156
|
+
|
157
|
+
Or, put any combination of custom settings in a separate YAML file:
|
158
|
+
|
159
|
+
```yaml
|
160
|
+
geoserver:
|
161
|
+
username: gs_username
|
162
|
+
password: gs_password
|
163
|
+
```
|
164
|
+
|
165
|
+
Which are automatically applied to the configuration when the gem is loaded.
|
166
|
+
|
167
|
+
#### Descriptive Metadata
|
168
|
+
|
169
|
+
Geoloader also makes it possible to provide text metadata about assets in Markdown files, which are parsed and merged into the records that are pushed out to the services. These files have three parts:
|
170
|
+
|
171
|
+
1. A YAML "front matter" section, delimited by `---` dividers. This makes it possible to provide arbitrary key-value metadata, which can be merged into records created by the concrete asset modules.
|
172
|
+
|
173
|
+
2. A leading `<h1>` element, represented in Markdown as a line that starts with a single `#` - eg, `# Testing Title`. This value is used as the generic title for the asset(s).
|
174
|
+
|
175
|
+
3. The rest of the Markdown document, which is used as an "abstract" or "description."
|
176
|
+
|
177
|
+
For example, here's what a description file for an upload to Geonetwork might look like:
|
178
|
+
|
179
|
+
```markdown
|
180
|
+
---
|
181
|
+
categories:
|
182
|
+
- category1
|
183
|
+
- category2
|
184
|
+
|
185
|
+
keywords:
|
186
|
+
- keyword1
|
187
|
+
- keyword2
|
188
|
+
---
|
189
|
+
|
190
|
+
# Testing Title
|
191
|
+
|
192
|
+
A testing abstract! More content here.
|
193
|
+
```
|
194
|
+
|
195
|
+
#### CLI Application
|
196
|
+
|
197
|
+
If you're using Geoloader as a command-line tool, provide custom settings in `~/.geoloader.yaml`, and the values will automatically be merged into the default configuration at runtime:
|
198
|
+
|
199
|
+
```yaml
|
200
|
+
# ~/.geoloader.yaml
|
201
|
+
|
202
|
+
geoserver:
|
203
|
+
username: gs_username
|
204
|
+
password: gs_password
|
205
|
+
```
|
206
|
+
|
207
|
+
[geotiff]: http://en.wikipedia.org/wiki/Geotiff
|
208
|
+
[shapefile]: http://en.wikipedia.org/wiki/Shapefile
|
209
|
+
[geoserver]: http://geoserver.org/
|
210
|
+
[geonetwork]: http://geonetwork-opensource.org/
|
211
|
+
[solr]: http://lucene.apache.org/solr/
|
212
|
+
[ogp-schema]: https://github.com/OpenGeoportal/ogpSolrConfig
|
data/Rakefile
ADDED
data/bin/geoloader
ADDED
data/config.yaml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
workspaces:
|
2
|
+
production: geoloader
|
3
|
+
testing: geoloader_test
|
4
|
+
|
5
|
+
solr:
|
6
|
+
url: http://localhost:8080/solr/geoloader
|
7
|
+
|
8
|
+
geoserver:
|
9
|
+
url: http://localhost:8080/geoserver
|
10
|
+
username: admin
|
11
|
+
password: geoserver
|
12
|
+
srs: EPSG:3857
|
13
|
+
|
14
|
+
geonetwork:
|
15
|
+
url: http://localhost:8080/geonetwork/srv/en
|
16
|
+
username: admin
|
17
|
+
password: admin
|
18
|
+
group: geoloader
|
data/geoloader.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'geoloader/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
|
9
|
+
s.name = "geoloader"
|
10
|
+
s.version = Geoloader::VERSION
|
11
|
+
s.authors = ["David McClure"]
|
12
|
+
s.email = ["david.mcclure@virginia.edu"]
|
13
|
+
s.summary = "Helpers for managing GIS metadata."
|
14
|
+
s.description = "Load GeoTIFFs and Shapefiles to Geoserver, Geonetwork, and Solr."
|
15
|
+
s.homepage = "https://github.com/scholarslab/Geoloader"
|
16
|
+
s.license = "Apache 2"
|
17
|
+
|
18
|
+
s.files = `git ls-files -z`.split("\x0")
|
19
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
21
|
+
s.require_paths = ["lib"]
|
22
|
+
|
23
|
+
s.add_development_dependency "bundler", "~> 1.5", ">= 1.5.3"
|
24
|
+
s.add_development_dependency "rake", "~> 10.1", ">= 10.1.1"
|
25
|
+
s.add_development_dependency "rspec", "~> 2.14", ">= 2.14.1"
|
26
|
+
|
27
|
+
s.add_dependency "require_all", "~> 1.3", ">= 1.3.2"
|
28
|
+
s.add_dependency "rsolr-ext", "~> 1.0", ">= 1.0.3"
|
29
|
+
s.add_dependency "rest-client", "~> 1.6", ">= 1.6.7"
|
30
|
+
s.add_dependency "thor", "~> 0.18", ">= 0.18.1"
|
31
|
+
s.add_dependency "confstruct", "~> 0.2", ">= 0.2.5"
|
32
|
+
s.add_dependency "resque", "~> 1.25", ">= 1.25.1"
|
33
|
+
s.add_dependency "nokogiri", "~> 1.6", ">= 1.6.1"
|
34
|
+
s.add_dependency "rubyzip", "~> 1.1", ">= 1.1.0"
|
35
|
+
s.add_dependency "jekyll", "~> 1.4", ">= 1.4.3"
|
36
|
+
|
37
|
+
end
|
data/iso19139.xsl
ADDED
@@ -0,0 +1,445 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3
|
+
xmlns:gmd="http://www.isotc211.org/2005/gmd"
|
4
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
5
|
+
xmlns:gts="http://www.isotc211.org/2005/gts"
|
6
|
+
xmlns:gco="http://www.isotc211.org/2005/gco"
|
7
|
+
xmlns:gml="http://www.opengis.net/gml"
|
8
|
+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
9
|
+
xmlns:geonet="http://www.fao.org/geonetwork"
|
10
|
+
xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd"
|
11
|
+
version="2.0">
|
12
|
+
|
13
|
+
<xsl:output method="xml" indent="yes"/>
|
14
|
+
|
15
|
+
<xsl:param name="title"/>
|
16
|
+
<xsl:param name="categories"/>
|
17
|
+
<xsl:param name="keywords"/>
|
18
|
+
<xsl:param name="identifier"/>
|
19
|
+
<xsl:param name="abstract"/>
|
20
|
+
<xsl:param name="wms_address"/>
|
21
|
+
<xsl:param name="wms_layers"/>
|
22
|
+
|
23
|
+
<xsl:template match="/">
|
24
|
+
<gmd:MD_Metadata>
|
25
|
+
|
26
|
+
<gmd:fileIdentifier>
|
27
|
+
<gco:CharacterString>
|
28
|
+
<xsl:value-of select="$identifier"/>
|
29
|
+
</gco:CharacterString>
|
30
|
+
</gmd:fileIdentifier>
|
31
|
+
|
32
|
+
<gmd:language>
|
33
|
+
<gco:CharacterString>
|
34
|
+
<xsl:copy-of select="/metadata/dataIdInfo/dataLang/languageCode[@value]"/>
|
35
|
+
</gco:CharacterString>
|
36
|
+
</gmd:language>
|
37
|
+
|
38
|
+
<gmd:characterSet>
|
39
|
+
<gmd:MD_CharacterSetCode codeListValue="utf8"
|
40
|
+
codeList="http://www.isotc211.org/2005/resources/codeList.xml#MD_CharacterSetCode"
|
41
|
+
/>
|
42
|
+
</gmd:characterSet>
|
43
|
+
|
44
|
+
<gmd:contact>
|
45
|
+
<gmd:CI_ResponsibleParty>
|
46
|
+
<gmd:organisationName>
|
47
|
+
<gco:CharacterString>Scholars' Lab</gco:CharacterString>
|
48
|
+
</gmd:organisationName>
|
49
|
+
<gmd:contactInfo>
|
50
|
+
<gmd:CI_Contact>
|
51
|
+
<gmd:phone>
|
52
|
+
<gmd:CI_Telephone>
|
53
|
+
<gmd:voice>
|
54
|
+
<gco:CharacterString>1-434-243-8800</gco:CharacterString>
|
55
|
+
</gmd:voice>
|
56
|
+
</gmd:CI_Telephone>
|
57
|
+
</gmd:phone>
|
58
|
+
<gmd:address>
|
59
|
+
<gmd:CI_Address>
|
60
|
+
<gmd:deliveryPoint>
|
61
|
+
<gco:CharacterString>Alderman Library, PO Box 400113</gco:CharacterString>
|
62
|
+
</gmd:deliveryPoint>
|
63
|
+
<gmd:city>
|
64
|
+
<gco:CharacterString>Charlottesville</gco:CharacterString>
|
65
|
+
</gmd:city>
|
66
|
+
<gmd:administrativeArea>
|
67
|
+
<gco:CharacterString>VA</gco:CharacterString>
|
68
|
+
</gmd:administrativeArea>
|
69
|
+
<gmd:postalCode>
|
70
|
+
<gco:CharacterString>22904-00113</gco:CharacterString>
|
71
|
+
</gmd:postalCode>
|
72
|
+
<gmd:country>
|
73
|
+
<gco:CharacterString>USA</gco:CharacterString>
|
74
|
+
</gmd:country>
|
75
|
+
<gmd:electronicMailAddress>
|
76
|
+
<gco:CharacterString>scholars.lab@gmail.com</gco:CharacterString>
|
77
|
+
</gmd:electronicMailAddress>
|
78
|
+
</gmd:CI_Address>
|
79
|
+
</gmd:address>
|
80
|
+
</gmd:CI_Contact>
|
81
|
+
</gmd:contactInfo>
|
82
|
+
<gmd:role>
|
83
|
+
<gmd:CI_RoleCode codeListValue="pointOfContact"
|
84
|
+
odeList="http://www.isotc211.org/2005/resources/codeList.xml#CI_RoleCode"
|
85
|
+
/>
|
86
|
+
</gmd:role>
|
87
|
+
</gmd:CI_ResponsibleParty>
|
88
|
+
</gmd:contact>
|
89
|
+
|
90
|
+
<gmd:metadataStandardName>
|
91
|
+
<gco:CharacterString xmlns:srv="http://www.isotc211.org/2005/srv">ISO
|
92
|
+
19115:2003/19139</gco:CharacterString>
|
93
|
+
</gmd:metadataStandardName>
|
94
|
+
|
95
|
+
<gmd:metadataStandardVersion>
|
96
|
+
<gmd:MD_ReferenceSystem>
|
97
|
+
<gmd:referenceSystemIdentifier>
|
98
|
+
<gmd:RS_Identifier>
|
99
|
+
<gmd:code>
|
100
|
+
<gco:CharacterString>
|
101
|
+
<xsl:apply-templates
|
102
|
+
select="/metadata/Esri/DataProperties/coordRef"/>
|
103
|
+
</gco:CharacterString>
|
104
|
+
</gmd:code>
|
105
|
+
</gmd:RS_Identifier>
|
106
|
+
</gmd:referenceSystemIdentifier>
|
107
|
+
</gmd:MD_ReferenceSystem>
|
108
|
+
</gmd:metadataStandardVersion>
|
109
|
+
|
110
|
+
<gmd:identificationInfo>
|
111
|
+
<gmd:MD_DataIdentification>
|
112
|
+
|
113
|
+
<gmd:citation>
|
114
|
+
<gmd:CI_Citation>
|
115
|
+
<gmd:title>
|
116
|
+
<gco:CharacterString>
|
117
|
+
<xsl:value-of select="$title"/>
|
118
|
+
</gco:CharacterString>
|
119
|
+
</gmd:title>
|
120
|
+
<gmd:date>
|
121
|
+
<gmd:CI_Date>
|
122
|
+
<gmd:date>
|
123
|
+
<gco:DateTime>
|
124
|
+
<xsl:value-of select="current-dateTime()"/>
|
125
|
+
</gco:DateTime>
|
126
|
+
</gmd:date>
|
127
|
+
<gmd:dateType>
|
128
|
+
<CI_DateTypeCode codeListValue="publication"
|
129
|
+
codeList="http://www.isotc211.org/2005/resources/codeList.xml#CI_DateTypeCode"
|
130
|
+
/>
|
131
|
+
</gmd:dateType>
|
132
|
+
</gmd:CI_Date>
|
133
|
+
</gmd:date>
|
134
|
+
<gmd:presentationForm>
|
135
|
+
<gmd:CI_PresentationFormCode codeListValue="mapDigital"
|
136
|
+
codeList="http://www.isotc211.org/2005/resources/codeList.xml#CI_PresentationFormCode"
|
137
|
+
/>
|
138
|
+
</gmd:presentationForm>
|
139
|
+
</gmd:CI_Citation>
|
140
|
+
</gmd:citation>
|
141
|
+
|
142
|
+
<gmd:abstract>
|
143
|
+
<gco:CharacterString>
|
144
|
+
<xsl:value-of select="$abstract" disable-output-escaping="yes"/>
|
145
|
+
</gco:CharacterString>
|
146
|
+
</gmd:abstract>
|
147
|
+
|
148
|
+
<gmd:purpose gco:nilReason="missing">
|
149
|
+
<gco:CharacterString/>
|
150
|
+
</gmd:purpose>
|
151
|
+
|
152
|
+
<gmd:status>
|
153
|
+
<gmd:MD_ProgressCode codeListValue=""
|
154
|
+
codeList="http://www.isotc211.org/2005/resources/codeList.xml#MD_ProgressCode"
|
155
|
+
/>
|
156
|
+
</gmd:status>
|
157
|
+
|
158
|
+
<gmd:pointOfContact>
|
159
|
+
<gmd:CI_ResponsibleParty>
|
160
|
+
|
161
|
+
<gmd:organisationName>
|
162
|
+
<gco:CharacterString>Scholars' Lab, Alderman Library, University of Virginia Library</gco:CharacterString>
|
163
|
+
</gmd:organisationName>
|
164
|
+
|
165
|
+
<gmd:contactInfo>
|
166
|
+
<gmd:CI_Contact>
|
167
|
+
<gmd:phone>
|
168
|
+
<gmd:CI_Telephone>
|
169
|
+
<gmd:voice>
|
170
|
+
<gco:CharacterString>1-434-243-8800</gco:CharacterString>
|
171
|
+
</gmd:voice>
|
172
|
+
</gmd:CI_Telephone>
|
173
|
+
</gmd:phone>
|
174
|
+
<gmd:address>
|
175
|
+
<gmd:CI_Address>
|
176
|
+
<gmd:deliveryPoint>
|
177
|
+
<gco:CharacterString>Alderman Library, PO Box 400113</gco:CharacterString>
|
178
|
+
</gmd:deliveryPoint>
|
179
|
+
<gmd:city>
|
180
|
+
<gco:CharacterString>Charlottesville</gco:CharacterString>
|
181
|
+
</gmd:city>
|
182
|
+
<gmd:administrativeArea>
|
183
|
+
<gco:CharacterString>VA</gco:CharacterString>
|
184
|
+
</gmd:administrativeArea>
|
185
|
+
<gmd:postalCode>
|
186
|
+
<gco:CharacterString>22904-00113</gco:CharacterString>
|
187
|
+
</gmd:postalCode>
|
188
|
+
<gmd:country>
|
189
|
+
<gco:CharacterString>USA</gco:CharacterString>
|
190
|
+
</gmd:country>
|
191
|
+
<gmd:electronicMailAddress>
|
192
|
+
<gco:CharacterString>scholars.lab@gmail.com</gco:CharacterString>
|
193
|
+
</gmd:electronicMailAddress>
|
194
|
+
</gmd:CI_Address>
|
195
|
+
</gmd:address>
|
196
|
+
</gmd:CI_Contact>
|
197
|
+
</gmd:contactInfo>
|
198
|
+
|
199
|
+
<gmd:role>
|
200
|
+
<gmd:CI_RoleCode
|
201
|
+
codeList="http://www.isotc211.org/2005/resources/codeList.xml#CI_RoleCode"
|
202
|
+
codeListValue="pointOfContact"/>
|
203
|
+
</gmd:role>
|
204
|
+
|
205
|
+
</gmd:CI_ResponsibleParty>
|
206
|
+
</gmd:pointOfContact>
|
207
|
+
|
208
|
+
<gmd:spatialRepresentationInfo>
|
209
|
+
<gmd:MD_Georectified>
|
210
|
+
|
211
|
+
<gmd:numberOfDimensions>
|
212
|
+
<gco:Integer>
|
213
|
+
<xsl:value-of select="/metadata/spatRepInfo/Georect/numDims"/>
|
214
|
+
</gco:Integer>
|
215
|
+
</gmd:numberOfDimensions>
|
216
|
+
|
217
|
+
<xsl:for-each select="/metadata/spatRepInfo/Georect/axisDimension">
|
218
|
+
<gmd:axisDimensionProperties>
|
219
|
+
<gmd:MD_Dimension>
|
220
|
+
<gmd:dimensionName>
|
221
|
+
<gmd:MD_DimensionNameTypeCode
|
222
|
+
codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_DimensionNameTypeCode"
|
223
|
+
codeListValue="column" codeSpace="ISOTC211/19115"
|
224
|
+
>column</gmd:MD_DimensionNameTypeCode>
|
225
|
+
</gmd:dimensionName>
|
226
|
+
<gmd:dimensionSize>
|
227
|
+
<gco:Integer>
|
228
|
+
<xsl:value-of select="dimSize"/>
|
229
|
+
</gco:Integer>
|
230
|
+
</gmd:dimensionSize>
|
231
|
+
<gmd:resolution>
|
232
|
+
<gco:Measure uom="Degree">
|
233
|
+
<xsl:value-of select="dimResol/value"/>
|
234
|
+
</gco:Measure>
|
235
|
+
</gmd:resolution>
|
236
|
+
</gmd:MD_Dimension>
|
237
|
+
</gmd:axisDimensionProperties>
|
238
|
+
</xsl:for-each>
|
239
|
+
|
240
|
+
<gmd:cellGeometry>
|
241
|
+
<gmd:MD_CellGeometryCode
|
242
|
+
codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CellGeometryCode"
|
243
|
+
codeListValue="area" codeSpace="ISOTC211/19115"
|
244
|
+
>area</gmd:MD_CellGeometryCode>
|
245
|
+
</gmd:cellGeometry>
|
246
|
+
|
247
|
+
<gmd:transformationParameterAvailability>
|
248
|
+
<gco:Boolean>true</gco:Boolean>
|
249
|
+
</gmd:transformationParameterAvailability>
|
250
|
+
|
251
|
+
<gmd:checkPointAvailability>
|
252
|
+
<gco:Boolean>false</gco:Boolean>
|
253
|
+
</gmd:checkPointAvailability>
|
254
|
+
|
255
|
+
<xsl:for-each select="/metadata/spatRepInfo/Georect/cornerPts">
|
256
|
+
<gmd:cornerPoints>
|
257
|
+
<gml:Point gml:id="{generate-id()}">
|
258
|
+
<xsl:value-of select="pos"/>
|
259
|
+
</gml:Point>
|
260
|
+
</gmd:cornerPoints>
|
261
|
+
</xsl:for-each>
|
262
|
+
|
263
|
+
<gmd:centerPoint>
|
264
|
+
<gml:Point
|
265
|
+
gml:id="{generate-id(/metadata/spatRepInfo/Georect/centerPt)}">
|
266
|
+
<gml:pos>
|
267
|
+
<xsl:value-of
|
268
|
+
select="/metadata/spatRepInfo/Georect/centerPt/pos"/>
|
269
|
+
</gml:pos>
|
270
|
+
</gml:Point>
|
271
|
+
</gmd:centerPoint>
|
272
|
+
|
273
|
+
<gmd:pointInPixel>
|
274
|
+
<MD_PixelOrientationCode>center</MD_PixelOrientationCode>
|
275
|
+
</gmd:pointInPixel>
|
276
|
+
|
277
|
+
</gmd:MD_Georectified>
|
278
|
+
</gmd:spatialRepresentationInfo>
|
279
|
+
|
280
|
+
<gmd:referenceSystemInfo>
|
281
|
+
<gmd:MD_ReferenceSystem>
|
282
|
+
<gmd:referenceSystemIdentifier>
|
283
|
+
<gmd:RS_Identifier>
|
284
|
+
<gmd:code>
|
285
|
+
<gco:CharacterString>
|
286
|
+
<xsl:value-of
|
287
|
+
select="/metadata/refSysInfo/RefSystem/refSysID/identCode/@code"
|
288
|
+
/>
|
289
|
+
</gco:CharacterString>
|
290
|
+
</gmd:code>
|
291
|
+
<gmd:codeSpace>
|
292
|
+
<gco:CharacterString>
|
293
|
+
<xsl:value-of
|
294
|
+
select="/metadata/refSysInfo/RefSystem/refSysID/idCodeSpace"
|
295
|
+
/>
|
296
|
+
</gco:CharacterString>
|
297
|
+
</gmd:codeSpace>
|
298
|
+
<gmd:version>
|
299
|
+
<gco:CharacterString>
|
300
|
+
<xsl:value-of
|
301
|
+
select="/metadata/refSysInfo/RefSystem/refSysID/idVersion"
|
302
|
+
/>
|
303
|
+
</gco:CharacterString>
|
304
|
+
</gmd:version>
|
305
|
+
</gmd:RS_Identifier>
|
306
|
+
</gmd:referenceSystemIdentifier>
|
307
|
+
</gmd:MD_ReferenceSystem>
|
308
|
+
</gmd:referenceSystemInfo>
|
309
|
+
|
310
|
+
<gmd:spatialRepresentationType>
|
311
|
+
<MD_SpatialRepresentationTypeCode
|
312
|
+
codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_SpatialRepresentationTypeCode"
|
313
|
+
codeListValue="grid" codeSpace="ISOTC211/19115"
|
314
|
+
>grid</MD_SpatialRepresentationTypeCode>
|
315
|
+
</gmd:spatialRepresentationType>
|
316
|
+
|
317
|
+
<gmd:language>
|
318
|
+
<LanguageCode
|
319
|
+
codeList="http://www.loc.gov/standards/iso639-2/php/code_list.php"
|
320
|
+
codeListValue="eng" codeSpace="ISO639-2">eng</LanguageCode>
|
321
|
+
</gmd:language>
|
322
|
+
|
323
|
+
<gmd:characterSet>
|
324
|
+
<gmd:MD_CharacterSetCode
|
325
|
+
codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode"
|
326
|
+
codeListValue="utf8" codeSpace="ISOTC211/19115"
|
327
|
+
>utf8</gmd:MD_CharacterSetCode>
|
328
|
+
</gmd:characterSet>
|
329
|
+
|
330
|
+
<gmd:environmentDescription>
|
331
|
+
<gco:CharacterString>Microsoft Windows 7 Version 6.1 (Build 7601) Service
|
332
|
+
Pack 1; ESRI ArcGIS 10.0.5.4400</gco:CharacterString>
|
333
|
+
</gmd:environmentDescription>
|
334
|
+
|
335
|
+
<gmd:extent>
|
336
|
+
<gmd:EX_Extent>
|
337
|
+
<gmd:geographicElement>
|
338
|
+
<gmd:EX_GeographicBoundingBox>
|
339
|
+
|
340
|
+
<gmd:extentTypeCode>
|
341
|
+
<gco:Boolean>true</gco:Boolean>
|
342
|
+
</gmd:extentTypeCode>
|
343
|
+
|
344
|
+
<gmd:westBoundLongitude>
|
345
|
+
<gco:Decimal>
|
346
|
+
<xsl:value-of
|
347
|
+
select="/metadata/Esri/DataProperties/itemProps/nativeExtBox/westBL"
|
348
|
+
/>
|
349
|
+
</gco:Decimal>
|
350
|
+
</gmd:westBoundLongitude>
|
351
|
+
|
352
|
+
<gmd:eastBoundLongitude>
|
353
|
+
<gco:Decimal>
|
354
|
+
<xsl:value-of
|
355
|
+
select="/metadata/Esri/DataProperties/itemProps/nativeExtBox/eastBL"
|
356
|
+
/>
|
357
|
+
</gco:Decimal>
|
358
|
+
</gmd:eastBoundLongitude>
|
359
|
+
|
360
|
+
<gmd:southBoundLatitude>
|
361
|
+
<gco:Decimal>
|
362
|
+
<xsl:value-of
|
363
|
+
select="/metadata/Esri/DataProperties/itemProps/nativeExtBox/southBL"
|
364
|
+
/>
|
365
|
+
</gco:Decimal>
|
366
|
+
</gmd:southBoundLatitude>
|
367
|
+
|
368
|
+
<gmd:northBoundLatitude>
|
369
|
+
<gco:Decimal>
|
370
|
+
<xsl:value-of
|
371
|
+
select="/metadata/Esri/DataProperties/itemProps/nativeExtBox/northBL"
|
372
|
+
/>
|
373
|
+
</gco:Decimal>
|
374
|
+
</gmd:northBoundLatitude>
|
375
|
+
|
376
|
+
</gmd:EX_GeographicBoundingBox>
|
377
|
+
</gmd:geographicElement>
|
378
|
+
</gmd:EX_Extent>
|
379
|
+
</gmd:extent>
|
380
|
+
|
381
|
+
<xsl:for-each select="tokenize($categories,',')">
|
382
|
+
<gmd:topicCategory>
|
383
|
+
<gmd:MD_TopicCategoryCode>
|
384
|
+
<xsl:value-of select="normalize-space(.)"/>
|
385
|
+
</gmd:MD_TopicCategoryCode>
|
386
|
+
</gmd:topicCategory>
|
387
|
+
</xsl:for-each>
|
388
|
+
|
389
|
+
<xsl:for-each select="tokenize($keywords,',')">
|
390
|
+
<gmd:descriptiveKeywords>
|
391
|
+
<gmd:MD_Keywords>
|
392
|
+
<gmd:keyword>
|
393
|
+
<gco:CharacterString>
|
394
|
+
<xsl:value-of select="normalize-space(.)"/>
|
395
|
+
</gco:CharacterString>
|
396
|
+
</gmd:keyword>
|
397
|
+
</gmd:MD_Keywords>
|
398
|
+
</gmd:descriptiveKeywords>
|
399
|
+
</xsl:for-each>
|
400
|
+
|
401
|
+
</gmd:MD_DataIdentification>
|
402
|
+
</gmd:identificationInfo>
|
403
|
+
|
404
|
+
<gmd:distributionInfo>
|
405
|
+
<gmd:MD_Distribution>
|
406
|
+
<gmd:transferOptions>
|
407
|
+
<gmd:MD_DigitalTransferOptions>
|
408
|
+
<gmd:onLine>
|
409
|
+
<gmd:CI_OnlineResource>
|
410
|
+
<gmd:linkage>
|
411
|
+
<gmd:URL>
|
412
|
+
<xsl:value-of select="$wms_address"/>
|
413
|
+
</gmd:URL>
|
414
|
+
</gmd:linkage>
|
415
|
+
<gmd:protocol>
|
416
|
+
<gco:CharacterString>WMS-1.1.1-http-get-capabilities</gco:CharacterString>
|
417
|
+
</gmd:protocol>
|
418
|
+
<gmd:name>
|
419
|
+
<gco:CharacterString>
|
420
|
+
<xsl:value-of select="$wms_layers"/>
|
421
|
+
</gco:CharacterString>
|
422
|
+
</gmd:name>
|
423
|
+
<gmd:description>
|
424
|
+
<gco:CharacterString>
|
425
|
+
<xsl:value-of select="$title"/>
|
426
|
+
</gco:CharacterString>
|
427
|
+
</gmd:description>
|
428
|
+
</gmd:CI_OnlineResource>
|
429
|
+
</gmd:onLine>
|
430
|
+
</gmd:MD_DigitalTransferOptions>
|
431
|
+
</gmd:transferOptions>
|
432
|
+
</gmd:MD_Distribution>
|
433
|
+
</gmd:distributionInfo>
|
434
|
+
|
435
|
+
</gmd:MD_Metadata>
|
436
|
+
</xsl:template>
|
437
|
+
|
438
|
+
<xsl:template match="coordRef">
|
439
|
+
<xsl:variable name="readable">
|
440
|
+
<xsl:copy-of select="translate(geogcsn, '_', ' ')"/>
|
441
|
+
</xsl:variable>
|
442
|
+
<xsl:value-of select="replace($readable, 'GCS ', '')"/>
|
443
|
+
</xsl:template>
|
444
|
+
|
445
|
+
</xsl:stylesheet>
|