Skip to content

Commit 3935bcb

Browse files
committed
Update the README
1 parent bc660cd commit 3935bcb

1 file changed

Lines changed: 26 additions & 5 deletions

File tree

README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,32 @@ $ gem install geo_combine
3232
## Usage
3333

3434
### Converting metadata
35-
35+
#### Converting metadata into GeoBlacklight JSON
36+
GeoCombine provides several classes representing different metadata standards that implement the `#to_geoblacklight` method for generating records in the [GeoBlacklight JSON format](https://opengeometadata.org/reference/):
37+
```ruby
38+
GeoCombine::Iso19139 # ISO 19139 XML
39+
GeoCombine::OGP # OpenGeoPortal JSON
40+
GeoCombine::Fgdc # FGDC XML
41+
GeoCombine::EsriOpenData # Esri Open Data Portal JSON
42+
GeoCombine::CkanMetadata # CKAN JSON
43+
```
44+
An example for converting an ISO 19139 XML record:
3645
```ruby
3746
# Create a new ISO19139 object
3847
> iso_metadata = GeoCombine::Iso19139.new('./tmp/opengeometadata/edu.stanford.purl/bb/338/jh/0716/iso19139.xml')
3948

40-
# Convert ISO to GeoBlacklight
49+
# Convert to GeoBlacklight's metadata format
4150
> iso_metadata.to_geoblacklight
4251

43-
# Convert that to JSON
52+
# Output it as JSON instead of a Ruby hash
4453
> iso_metadata.to_geoblacklight.to_json
54+
```
55+
Some formats also support conversion into HTML for display in a web browser:
56+
```ruby
57+
# Create a new ISO19139 object
58+
> iso_metadata = GeoCombine::Iso19139.new('./tmp/opengeometadata/edu.stanford.purl/bb/338/jh/0716/iso19139.xml')
4559

46-
# Convert ISO (or FGDC) to HTML
60+
# Convert ISO to HTML
4761
> iso_metadata.to_html
4862
```
4963

@@ -73,7 +87,7 @@ id_map = {
7387
GeoCombine::Migrators::V1AardvarkMigrator.new(v1_hash: record, collection_id_map: id_map).run
7488
```
7589

76-
### OpenGeoMetadata
90+
### Downloading metadata from OpenGeoMetadata
7791

7892
#### Logging
7993

@@ -144,6 +158,13 @@ You can also set a the Solr instance URL using `SOLR_URL`:
144158
$ SOLR_URL=http://www.example.com:1234/solr/collection bundle exec rake geocombine:index
145159
```
146160

161+
By default, GeoCombine will index only records using the Aardvark metadata format. If you instead want to index records using an older format (e.g. because your GeoBlacklight instance is version 3 or older), you can set the `SCHEMA_VERSION` environment variable:
162+
163+
```sh
164+
# Only index schema version 1.0 records
165+
$ SCHEMA_VERSION=1.0 bundle exec rake geocombine:index
166+
```
167+
147168
### Harvesting and indexing documents from GeoBlacklight sites
148169

149170
GeoCombine provides a Harvester class and rake task to harvest and index content from GeoBlacklight sites (or any site that follows the Blacklight API format). Given that the configurations can change from consumer to consumer and site to site, the class provides a relatively simple configuration API. This can be configured in an initializer, a wrapping rake task, or any other ruby context where the rake task our class would be invoked.

0 commit comments

Comments
 (0)