Skip to main content

Posts

Showing posts with the label Recipes

Scraping Portal Discovery Metadata and Merging it with Standards Documentation Metadata

Summary  This post describes a technique for scraping Portal Discovery Metadata from a custom site and merging it with Standards Documentation Metadata in accompanying XML files. The example portal used is PASDA , but this could be modified for other repositories. Background The BTAA GDP aggregates metadata to provide a catalog of geospatial resources from public data providers.  There are generally two types of sources for the metadata: Portal Discovery Metadata : This is found within the data provider's portal application and may include minimal elements, such as title, date, description, and links.  Several structured data portal applications, such as ArcGIS Hub and Socrata provide this through their API as DCAT.  Other portals, such as CKAN, have APIs that expose the Portal Discovery Metadata in a custom schema.   Standards Documentation Metadata : This is a file that accompanies the dataset and includes much more detail, such as ...

Adding Place keywords from GeoNames to map records

The GeoBlacklight plugin for Omeka includes a custom feature in the Spatial Coverage field. A user can type in a place term, which will query GeoNames, and produce a dropdown list of options.  The user selects a value from the list, and this will pull in the GeoNames URI. The user can select multiple place names using multiple inputs.   A second feature of the plugin is that it can pull the bounding box coordinates from the GeoNames official record.  This is triggered during export to the GeoBlacklight schema JSON file if the Bounding Box element for the item is empty.  Although users can add multiple place names, only the first input will be queried for this function. When you begin typing in this input, it will query the GeoNames API and pull suggestions for defined place names.    NOTE:  This feature is constrained by the fact that our site is hosted on an https site, but the GeoNames API query is on http.  This means that your brows...

Generate Technical Metadata for GIS Data

Technical Metadata for GIS Data Technical metadata can be programmatically extracted from the dataset. Step 1: Generate or Update the Technical Metadata How to generate an ArcGIS 1.0 XML file for a dataset one at a time. Open ArcCatalog and use the Catalog Tree to navigate to the location of the dataset. Click on the dataset in the catalog tree. Open the Description tab in the main window.  This action will update or create a new metadata file in the ArcGIS Metadata 1.0 Format.   How to generate an ArcGIS 1.0 XML file for a batch of files. Download the datasets and unzip all of the files into a flat folder.   With 7-Zip, use the option without the “*/”, which will keep the files in separate folders Folders can be flattened with the following command line script (Mac tested):   find [DIRECTORY] -mindepth 2 -type f -exec mv -i '{}' [DIRECTORY] ';' Download a zip of the project’s Custom ArcGIS Toolbox of Batch Metadata Scripts. Unzip t...

Batch Transform FGDC to ISO 19139

There are two options for how to do this. Option 1:  Obtain standalone XML files and use the FGDC to ArcGIS Translator tool Option 2:  Download the dataset and use the ArcGIS Update tool Before you begin: Download a zip of the project’s Custom ArcGIS Toolbox of Batch Metadata Scripts. Unzip the folder into a location that you can access from within ArcCatalog. Option 1: Standalone XML files Use the Esri Translator with FGDC2Esri_ISO selected on standalone XML files. All metadata except the reference system information will be retained. 1. Place the XML files in their own folder.  Make sure that no other types of files are in the folder. 2. Open ArcCatalog and use the Catalog Tree to navigate to the downloaded folder of custom scripts. 3. Expand the toolbox and select the tool called “Translate FGDC to ArcGIS for Standalone XML file” 4. The input is only the folder containing the XML files.  Details about the tool: The input is a fol...

Harvest datasets in a batch with WGET or a Browser Plugin

WGET This command line program can download batches of datasets or just XML files.   Some recipes to try: Download all zipped files from an FTP site: wget -r --no-parent -A.zip name of site Download only the XML files from an online folder: wget -r -l 1 -np -A '*.xml' name of site To download all ZIP files from a DCAT JSON: Create a CSV from the JSON file (see above section called Harvesting Metadata from ArcGIS Open Data or Socrata portals) Save a copy with only the download links (ZIP files) Use this spreadsheet to download the datasets: wget -i filename.csv Troubleshooting Note: ArcGIS portals create the downloadable shapefiles on the fly- this means that they may time out or cause errors when trying to download batches or even singly. Browser Plug-ins A browser plugin is another way of downloading datasets.  This option may work if WGET fails. As of this writing, a useful one for Chrome is Tab Save , where the user can just p...

Using sentence-case for keywords in OpenRefine

Issue Capitalization and pluralization of ingested keywords vary.  Our keyword list for in GeoBlacklight is somewhat messy and contains near duplicates. Challenge Our instance of Solr for GeoBlacklight indexes Dog, dog, dogs as separate keywords. Solution Use OpenRefine to normalize keywords before importing to Solr. Description As we aggregate metadata records from multiple sources, we found that the keywords need attention. The GIS records have keyword groups that may or may not come from a thesaurus, but frequently are coming from the TAGS field in ArcGIS Open Data Portals.  As a result, the keywords are frequently just regional acronyms or abbreviations and often have many spelling variants. We also anticipate combining our metadata records with those made at other institutions outside of the Big Ten Academic Alliance Geospatial Data Project.  After reviewing records from other universities and consulting the RDA rules on capitalization , we decided to...