Author image Mark Overmeer
and 1 contributors

NAME

Geo::EOP - Earth Observation Products EOP

INHERITANCE

 Geo::EOP
   is a Geo::GML
   is a XML::Compile::Cache
   is a XML::Compile::Schema
   is a XML::Compile

SYNOPSIS

 use Geo::EOP ':eop1.1';

 my $eop = Geo::EOP->new(eop_version => '1.1');

 # see XML::Compile::Cache on how to use readers and writers
 my $data = $eop->reader("gml:GridCoverage")->($xmlmsg);
 my $xml  = $eop->writer($sometype)->($doc, $perldata);

 # or without help of the cache, XML::Compile::Schema
 my $r    = $gml->compile(READER => $sometype);
 my $data = $r->($xml);

 # read a eop data file.  Autodetects the version used.
 my ($type, $data) = $eop->from('data.xml');
 my ($type, $data) = Geo::EOP->from('data.xml');
 print "Root type:   $type\n";
 print "EOP version: $data->{version}\n";

 # huge overview on all defined elements
 $gml->printIndex;

DESCRIPTION

Provides access to the EOP definitions specified as XML schemas, based on GML. Up to version 1.0, these schemas where named 'HMA' (Heterogeneous EO Missions Accessibility), and the development is still part of these ESA efforts for standardization.

BE WARNED that HMA1.0 and EOP 1.1/1.2 are only using a subset of GML version 3.1.1, due to problems with some software tools. This limitation will probably be removed in 1.3 (or whatever the next version will be named).

The first releases of this module will not powerful, but hopefully people contribute. For instance, an example conversion script between various versions is very welcome! It would be nice to help each other. I will clean-up the implementation, to make it publishable, but do not have the knowledge about needed to implement the converter itself.

Extends "DESCRIPTION" in Geo::GML.

METHODS

Extends "METHODS" in Geo::GML.

Constructors

Extends "Constructors" in Geo::GML.

$obj->from(XMLDATA, OPTIONS)
Geo::EOP->from(XMLDATA, OPTIONS)

Read a EOP structure from a data source, which can be anything acceptable by dataToXML(): a XML::LibXML::Element, XML as string or ref-string, filename, filehandle or known namespace.

Returned is the product (the type of the root node) and the parsed data-structure. The EOP version used for decoding is autodetected, unless specified.

See examples/read_eop.pl

example:

  my ($type, $data) = $eop->from('data.xml');
  my ($type, $data) = Geo::EOP->from('data.xml');
Geo::EOP->new(OPTIONS)
 -Option            --Defined in          --Default
  allow_undeclared    Geo::GML              <true>
  any_element         XML::Compile::Cache   ATTEMPT
  block_namespace     XML::Compile::Schema  []
  eop_version                               <required>
  hook                XML::Compile::Schema  undef
  hooks               XML::Compile::Schema  []
  ignore_unused_tags  XML::Compile::Schema  <false>
  key_rewrite         XML::Compile::Schema  []
  opts_readers        XML::Compile::Cache   []
  opts_rw             XML::Compile::Cache   <some>
  opts_writers        XML::Compile::Cache   []
  parser_options      XML::Compile          <many>
  prefixes            Geo::GML              undef
  schema_dirs         XML::Compile          undef
  typemap             XML::Compile::Cache   {}
  units                                     <none>
  version             Geo::GML              <required>
  xsi_type            XML::Compile::Cache   {}
allow_undeclared => BOOLEAN
any_element => CODE|'TAKE_ALL'|'SKIP_ALL'|'ATTEMPT'|'SLOPPY'
block_namespace => NAMESPACE|TYPE|HASH|CODE|ARRAY
eop_version => VERSION|NAMESPACE

Only used when the object is created directly from this base-class. It determines which EOP syntax is to be used. Can be a VERSION like "1.1" or a NAMESPACE URI like 'NS_EOP_11'.

hook => HOOK|ARRAY
hooks => ARRAY
ignore_unused_tags => BOOLEAN|REGEXP
key_rewrite => HASH|CODE|ARRAY
opts_readers => HASH|ARRAY-of-PAIRS
opts_rw => HASH|ARRAY-of-PAIRS
opts_writers => HASH|ARRAY-of-PAIRS
parser_options => HASH|ARRAY
prefixes => ARRAY|HASH
schema_dirs => DIRECTORY|ARRAY-OF-DIRECTORIES
typemap => HASH|ARRAY
units => HASH

See "Units". Only if you specify your preference in units of measurement, some automatic translations will be performed.

version => VERSION|NAMESPACE
xsi_type => HASH|ARRAY

Accessors

Extends "Accessors" in Geo::GML.

$obj->addHook($hook|LIST|undef)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addHooks( $hook, [$hook, ...] )

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addKeyRewrite($predef|CODE|HASH, ...)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addSchemaDirs(@directories|$filename)
Geo::EOP->addSchemaDirs(@directories|$filename)

Inherited, see "Accessors" in XML::Compile

$obj->addSchemas($xml, %options)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addTypemap(PAIR)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addTypemaps(PAIRS)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->addXsiType( [HASH|ARRAY|LIST] )

Inherited, see "Accessors" in XML::Compile::Cache

$obj->allowUndeclared( [BOOLEAN] )

Inherited, see "Accessors" in XML::Compile::Cache

$obj->anyElement('ATTEMPT'|'SLOPPY'|'SKIP_ALL'|'TAKE_ALL'|CODE)

Inherited, see "Accessors" in XML::Compile::Cache

$obj->blockNamespace($ns|$type|HASH|CODE|ARRAY)

Inherited, see "Accessors" in XML::Compile::Schema

$obj->direction()

Inherited, see "Accessors" in Geo::GML

$obj->eopVersion()

EOP/HMA version, for instance '1.0'.

$obj->hooks( [<'READER'|'WRITER'>] )

Inherited, see "Accessors" in XML::Compile::Schema

$obj->typemap( [HASH|ARRAY|PAIRS] )

Inherited, see "Accessors" in XML::Compile::Cache

$obj->useSchema( $schema, [$schema, ...] )

Inherited, see "Accessors" in XML::Compile::Schema

$obj->version()

Inherited, see "Accessors" in Geo::GML

Prefix management

Extends "Prefix management" in Geo::GML.

$obj->addNicePrefix(BASE, NAMESPACE)

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->addPrefixes( [PAIRS|ARRAY|HASH] )

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->learnPrefixes($node)

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->prefix($prefix)

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->prefixFor($uri)

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->prefixed( $type|<$ns,$local> )

Inherited, see "Prefix management" in XML::Compile::Cache

$obj->prefixes( [$params] )

Inherited, see "Prefix management" in XML::Compile::Cache

Compilers

Extends "Compilers" in Geo::GML.

$obj->addCompileOptions( ['READERS'|'WRITERS'|'RW'], %options )

Inherited, see "Compilers" in XML::Compile::Cache

$obj->compile( <'READER'|'WRITER'>, $type, %options )

Inherited, see "Compilers" in XML::Compile::Schema

$obj->compileAll( ['READERS'|'WRITERS'|'RW', [$ns]] )

Inherited, see "Compilers" in XML::Compile::Cache

$obj->compileType( <'READER'|'WRITER'>, $type, %options )

Inherited, see "Compilers" in XML::Compile::Schema

$obj->dataToXML($node|REF-XML|XML-STRING|$filename|$fh|$known)
Geo::EOP->dataToXML($node|REF-XML|XML-STRING|$filename|$fh|$known)

Inherited, see "Compilers" in XML::Compile

$obj->initParser(%options)
Geo::EOP->initParser(%options)

Inherited, see "Compilers" in XML::Compile

$obj->reader($type|$name, %options)

Inherited, see "Compilers" in XML::Compile::Cache

$obj->template('PERL'|'XML', TYPE, OPTIONS)

Inherited, see "Compilers" in Geo::GML

$obj->writer($type|$name)

Inherited, see "Compilers" in XML::Compile::Cache

Helpers

Extends "Helpers" in Geo::GML.

$obj->GPtoGML(OBJECT, OPTIONS)

Inherited, see "Helpers" in Geo::GML::GeoPoint

Administration

Extends "Administration" in Geo::GML.

$obj->declare( <'READER'|'WRITER'|'RW'>, <$type|ARRAY>, %options )

Inherited, see "Administration" in XML::Compile::Cache

$obj->doesExtend($exttype, $basetype)

Inherited, see "Administration" in XML::Compile::Schema

$obj->elements()

Inherited, see "Administration" in XML::Compile::Schema

$obj->findName($name)

Inherited, see "Administration" in XML::Compile::Cache

$obj->findSchemaFile($filename)
Geo::EOP->findSchemaFile($filename)

Inherited, see "Administration" in XML::Compile

$obj->importDefinitions($xmldata, %options)

Inherited, see "Administration" in XML::Compile::Schema

$obj->knownNamespace($ns|PAIRS)
Geo::EOP->knownNamespace($ns|PAIRS)

Inherited, see "Administration" in XML::Compile

$obj->namespaces()

Inherited, see "Administration" in XML::Compile::Schema

$obj->printIndex( [FILEHANDLE], OPTIONS )

List all the elements which can be produced with the schema. By default, this only shows the elements and excludes the abstract elements from the list. The selected FILEHANDLE is the default to print to.

 -Option       --Defined in         --Default
  show_declared  XML::Compile::Cache  <true>
show_declared => BOOLEAN
$obj->types()

Inherited, see "Administration" in XML::Compile::Schema

$obj->walkTree($node, CODE)

Inherited, see "Administration" in XML::Compile

DETAILS

Extends "DETAILS" in Geo::GML.

Distribution collection overview

Extends "Distribution collection overview" in Geo::GML.

Comparison

Extends "Comparison" in Geo::GML.

Collecting definitions

Extends "Collecting definitions" in Geo::GML.

Addressing components

Extends "Addressing components" in Geo::GML.

Representing data-structures

Extends "Representing data-structures" in Geo::GML.

Schema hooks

Extends "Schema hooks" in Geo::GML.

Typemaps

Extends "Typemaps" in Geo::GML.

Handling xsi:type

Extends "Handling xsi:type" in Geo::GML.

Key rewrite

Extends "Key rewrite" in Geo::GML.

Units

GML is careful about its units, which is nice but verbose. Therefore, this module gives you a way to set your preferences. The reader will simplify the structure, re-calculating the values found into the units of measure you prefer, according to UCUM (http://aurora.regenstrief.org/ucum)

  my $eop = Geo::EOP->new(...
     , units => { distance => 'm'
                , angle    => 'deg' }
     );

Available conversions:

angle 'deg'|'rad'

Will be applied to all AngleType elements

distance 'm'

Will be applied to all MeasureType elements

percentage '%'|'float'

Will be applied to all elements with a name ending on "Percentage". I am not sure about the float... cannot find the uom name.

DESCRIPTIONS

Extends "DESCRIPTIONS" in Geo::GML.

SEE ALSO

This module is part of Geo-EOP distribution version 0.50, built on July 21, 2015. Website: http://perl.overmeer.net/geo/ All modules in this suite: "Geo::GML", "Geo::ISO19139", "Geo::EOP", "Geo::Point", "Geo::Proj4", "Geo::WKT", and "Math::Polygon".

Please post questions or ideas to https://list.hut.fi/mailman/listinfo/geo-perl|the Geo-Perl mailinglist

COPYRIGHTS

License of the CODE

Copyrights of the perl code and the related documentation by 2008-2015 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html

License of the SCHEMAS

The included schemas are copyrighted by the Open Geospatial Consortium, Inc. They are unmodified copied from the files at http://schemas.opengis.net. Read OGCs disclaimer and copyright statements on documentation and software at http://www.opengeospatial.org/ogc/legal. The license text is also included in this CPAN distribution.