Skip to content

Instantly share code, notes, and snippets.

@etoyoda
etoyoda / gawsis.md
Last active December 16, 2015 08:08
IPET-MDRD's review of WIS Discovery Metadata made by GAWSIS

summary

  • no problem
    • well-formed XML
  • some issues in
    • validity against XSD of ISO 19139
    • non-XSD requirements of ISO
    • recommendations in WCMP (WMO Core Metadata Profile)
    • use of "googleMaps" as geographicElement
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
>
<xsl:output method="xml"/>
<xsl:template match="/">
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<title>Requirements not enforceable with XML Schema (Table A.1) of ISO/TS 19139:2006</title>
<ns prefix="gmd" uri="http://www.isotc211.org/2005/gmd"/>
<pattern xml:id="iso19139taba1pat" id="iso19139taba1pat">
<rule context="gmd:CI_ResponsibleParty">
<assert
id="ISO19139.TA1.responsibleParty:"
flag="M-ISO"
@etoyoda
etoyoda / svrl2htm.xslt
Created April 22, 2013 18:02
Schematron リファレンス実装の吐く XSLT を強引に書き換えて SVRL ではなく HTML を吐く XSLT を出力する XSLT を出力するようにする XSLT
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
>
<xsl:output method="xml"/>
<xsl:template match="/">
@etoyoda
etoyoda / tt-apmd-2-doc3.5.md
Last active December 18, 2015 23:59
presentation on GAW

EXPERIENCES IN WIS METADATA FOR GAW AND PROPOSALS

what is GAW

The Global Atmosphere Watch (GAW) is a WMO Programme to provide scientific data and information on the chemical composition of the atmosphere and its natural and anthropogenic change, and to improve the understanding of interactions between the atmosphere, the oceans and the biosphere. source: WMO Website http://www.wmo.int/pages/prog/arep/gaw/gaw_home_en.html

works

  • WDCGG implementations
@etoyoda
etoyoda / gawsis2013-08-08.md
Last active December 21, 2015 17:28
review on example metadata records from GAWSIS received on 2013-08-08.

introduction

  • 8 out of 10 received records are not well-formed XML
  • all 10 received records did not validate against XML Schema
  • style: keywords from unclear sources

well-formedness

  • ill-formed records are due to raw ampersand '&' in xlink:href attribute
  • please be careful not to create ill-formed XML
@etoyoda
etoyoda / nsdecl.rb
Created December 20, 2013 11:25
Ruby script to detect default namespace declaration in an OAI-PMH response containing metadata records in ISO/TS 19139. Output is tab-separated text containing lines with two columns of (1) last namespace URI and (2) gmd:fileIdentifier/*/text(). Tested with ruby-1.8.7, libxml-ruby 1.1.3, and libxml2 20706.
require 'rubygems'
require 'xml'
include XML
class Scanner
def initialize parent
@parent = parent
@reader = @xpath = nil
@etoyoda
etoyoda / fitmap.md
Last active August 29, 2015 14:10
map fitting

経緯線交点のピクセル座標を読み取った結果 (左から、経度、緯度、X座標、下向きY座標)

$ cat aupq78.txt
#proj +proj=stere +lat_ts=60 +lat_0=90 +lon_0=50 +k_0=1.0 +x_0=-1962800 +y_0=7405800 +ellps=GRS80
80/30/384/391
80/40/685/217
100/30/789/872
100/10/261/1501
@etoyoda
etoyoda / bufrtemptypes.md
Last active August 29, 2015 14:14
Precision-based heuristic algorithm to identify types of BUFR TEMPs (native/reformatted and parts)

Precision-based heuristic algorithm to identify types of BUFR TEMP messages

TOYODA Eizi

Introduction

Here I show an algorithm to identify types of BUFR TEMPs to tell whether the message is native or reformatted, and what part(s) are used for reformatting. An implementation is found here. Both are just a quick hack that worked with bulletins of small number of days. NO WARRANTY.

Design Principles

Avoid relying on external database

@etoyoda
etoyoda / posttemp.rb
Last active August 29, 2015 14:14
Postprocessing of libecbufr to make stats of TEMP BUFRS
#!/usr/bin/ruby
class BufrMsg
def initialize
@head = {}
@edition = nil
end
def inject key, val