GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GEO::GML (3)

.ds Aq ’

NAME

Geo::GML - Geography Markup Language processing

CONTENTS

INHERITANCE



 Geo::GML has extra code in
   Geo::GML::GeoPoint

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



SYNOPSIS



 use Geo::GML :gml321;

 my $gml = Geo::GML->new(READER, version => 3.2.1);

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

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

 # super simple
 my ($type, $data) = Geo::GML->from(data.xml);

 # overview (large) on all defined elements
 $gml->printIndex;

 # To discover the perl datastructures to be passed
 print $gml->template("gml:Surface");

 # autoloaded logic to convert Geo::Point into GML
 $data->{...somewhere...} = $gml->GPtoGML($objects);



DESCRIPTION

Provides access to the GML definitions specified in XML. The details about GML structures can differ, and therefore you should be explicit which versions you understand and produce.

If you need the <b>most recent</b> version of GML, then you get involved with the ISO19139 standard. See CPAN module Geo::ISO19139.

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 what is needed.

See documentation in the base class.

METHODS

See documentation in the base class.

    Constructors

See documentation in the base class.
Geo::GML-><B>fromB>(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_gml.pl

example:



  my ($type, $data) = Geo::GML->from(data.xml);



Geo::GML-><B>newB>(’READER’|’WRITER’|’RW’, OPTIONS)


 -Option            --Defined in          --Default
  allow_undeclared                          <true>
  any_element         XML::Compile::Cache   ATTEMPT
  block_namespace     XML::Compile::Schema  []
  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                                  undef
  schema_dirs         XML::Compile          undef
  typemap             XML::Compile::Cache   {}
  version                                   <required>
  xsi_type            XML::Compile::Cache   {}



allow_undeclared => BOOLEAN In the optimal case, all types used in your application are declared during the initiation phase of your program. This will make it easy to write a fast daemon application, or transform your program into a daemon later. So: false would be a good setting. However, on the moment, the developer of this module has no idea which types people will use. Please help me with the specs!

All any elements will be ATTEMPTed to be processed at run-time by default.

The GML specification will require PREFIXED key rewrite, because the complexity of namespaces is enormous. Besides, mixed elements are processed as STRUCTURAL by default (mixed in texts ignored).

any_element => CODE|’TAKE_ALL’|’SKIP_ALL’|’ATTEMPT’|’SLOPPY
block_namespace => NAMESPACE|TYPE|HASH|CODE|ARRAY
hook => ARRAY-WITH-HOOKDATA | HOOK
hooks => ARRAY-OF-HOOK
ignore_unused_tags => BOOLEAN|REGEXP
key_rewrite => HASH|CODE|ARRAY-of-HASH-and-CODE
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 Prefix abbreviations, to be used by cache object. Which prefixes are defined depends on the schema version.
schema_dirs => DIRECTORY|ARRAY-OF-DIRECTORIES
typemap => HASH|ARRAY
version => VERSION|NAMESPACE Only used when the object is created directly from this base-class. It determines which GML syntax is to be used. Can be a VERSION like 3.1.1 or a NAMESPACE URI like ’NS_GML_300’.
xsi_type => HASH|ARRAY

    Accessors

See documentation in the base class.
$obj-><B>addHookB>(HOOKDATA|HOOK|undef) See Accessors in XML::Compile::Schema
$obj-><B>addHooksB>(HOOK, [HOOK, ...]) See Accessors in XML::Compile::Schema
$obj-><B>addKeyRewriteB>(PREDEF|CODE|HASH, ...) See Accessors in XML::Compile::Schema
$obj-><B>addSchemaDirsB>(DIRECTORIES|FILENAME)
Geo::GML-><B>addSchemaDirsB>(DIRECTORIES|FILENAME) See Accessors in XML::Compile
$obj-><B>addSchemasB>(XML, OPTIONS) See Accessors in XML::Compile::Schema
$obj-><B>addTypemapB>(PAIR) See Accessors in XML::Compile::Schema
$obj-><B>addTypemapsB>(PAIRS) See Accessors in XML::Compile::Schema
$obj-><B>addXsiTypeB>([HASH|ARRAY|LIST]) See Accessors in XML::Compile::Cache
$obj-><B>allowUndeclaredB>([BOOLEAN]) See Accessors in XML::Compile::Cache
$obj-><B>anyElementB>(’ATTEMPT’|’SLOPPY’|’SKIP_ALL’|’TAKE_ALL’|CODE) See Accessors in XML::Compile::Cache
$obj-><B>blockNamespaceB>(NAMESPACE|TYPE|HASH|CODE|ARRAY) See Accessors in XML::Compile::Schema
$obj-><B>directionB>() Returns ’READER’, ’WRITER’, or ’RW’.
$obj-><B>hooksB>([READER|WRITER]) See Accessors in XML::Compile::Schema
$obj-><B>typemapB>([HASH|ARRAY|PAIRS]) See Accessors in XML::Compile::Cache
$obj-><B>useSchemaB>(SCHEMA, [SCHEMA]) See Accessors in XML::Compile::Schema
$obj-><B>versionB>() GML version, for instance ’3.2.1’.

    Prefix management

See documentation in the base class.
$obj-><B>addPrefixesB>([PAIRS|ARRAY|HASH]) See Prefix management in XML::Compile::Cache
$obj-><B>learnPrefixesB>(NODE) See Prefix management in XML::Compile::Cache
$obj-><B>prefixB>(PREFIX) See Prefix management in XML::Compile::Cache
$obj-><B>prefixForB>(URI) See Prefix management in XML::Compile::Cache
$obj-><B>prefixedB>(TYPE|(NAMESPACE,LOCAL)) See Prefix management in XML::Compile::Cache
$obj-><B>prefixesB>([PARAMS]) See Prefix management in XML::Compile::Cache

    Compilers

See documentation in the base class.
$obj-><B>addCompileOptionsB>([’READERS’|’WRITERS’|’RW’], OPTIONS) See Compilers in XML::Compile::Cache
$obj-><B>compileB>((’READER’|’WRITER’), TYPE, OPTIONS) See Compilers in XML::Compile::Schema
$obj-><B>compileAllB>([’READERS’|’WRITERS’|’RW’, [NAMESPACE]]) See Compilers in XML::Compile::Cache
$obj-><B>dataToXMLB>(NODE|REF-XML-STRING|XML-STRING|FILENAME|FILEHANDLE|KNOWN)
Geo::GML-><B>dataToXMLB>(NODE|REF-XML-STRING|XML-STRING|FILENAME|FILEHANDLE|KNOWN) See Compilers in XML::Compile
$obj-><B>initParserB>(OPTIONS)
Geo::GML-><B>initParserB>(OPTIONS) See Compilers in XML::Compile
$obj-><B>readerB>(TYPE|NAME, OPTIONS) See Compilers in XML::Compile::Cache
$obj-><B>templateB>(’PERL’|’XML’, TYPE, OPTIONS) See XML::Compile::Schema::template(). This will create an example of the data-structure based on GML. All OPTIONS are passed to the template generator, the only reason to have this method, is to avoid the need to collect all the GML XML files yourself.



 -Option              --Defined in          --Default
  abstract_types        XML::Compile::Schema  ERROR
  attributes_qualified  XML::Compile::Schema  <undef>
  elements_qualified    XML::Compile::Schema  TOP
  include_namespaces    XML::Compile::Schema  <true>
  indent                XML::Compile::Schema  " "
  key_rewrite           XML::Compile::Schema  []
  show_comments         XML::Compile::Schema  ALL
  skip_header           XML::Compile::Schema  <false>



abstract_types => ’ERROR’|’ACCEPT
attributes_qualified => BOOLEAN
elements_qualified => ’ALL’|’TOP’|’NONE’|BOOLEAN
include_namespaces => BOOLEAN|CODE
indent => STRING
key_rewrite => HASH|CODE|ARRAY-of-HASH-and-CODE
show_comments => STRING|’ALL’|’NONE
skip_header => BOOLEAN

example:



  use Geo::GML;
  use Geo::GML::Util     qw/NS_GML_321/;
  use XML::Compile::Util qw/pack_type/;
  my $gml   = Geo::GML->new(version => NS_GML_321);

  # to simplify the output, reducing often available large blocks
  my @types = qw/gml:MetaDataPropertyType gml:StringOrRefType
     gml:ReferenceType/;
  my %hook  = (type => \@collapse_types, replace => COLLAPSE);

  # generate the data-structure
  my $type  = gml:RectifiedGridCoverage;  # any element name
  print $gml->template(PERL => $type, hook => \%hook);



$obj-><B>writerB>(TYPE|NAME) See Compilers in XML::Compile::Cache

    Helpers

$obj-><B>GPtoGMLB>(OBJECT, OPTIONS) See Helpers in Geo::GML::GeoPoint

    Administration

See documentation in the base class.
$obj-><B>declareB>(’READER’|’WRITER’|’RW’, TYPE|ARRAY-of-TYPES, OPTIONS) See Administration in XML::Compile::Cache
$obj-><B>doesExtendB>(EXTTYPE, BASETYPE) See Administration in XML::Compile::Schema
$obj-><B>elementsB>() See Administration in XML::Compile::Schema
$obj-><B>findNameB>(NAME) See Administration in XML::Compile::Cache
$obj-><B>findSchemaFileB>(FILENAME)
Geo::GML-><B>findSchemaFileB>(FILENAME) See Administration in XML::Compile
$obj-><B>importDefinitionsB>(XMLDATA, OPTIONS) See Administration in XML::Compile::Schema
$obj-><B>knownNamespaceB>(NAMESPACE|PAIRS)
Geo::GML-><B>knownNamespaceB>(NAMESPACE|PAIRS) See Administration in XML::Compile
$obj-><B>namespacesB>() See Administration in XML::Compile::Schema
$obj-><B>printIndexB>([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-><B>typesB>() See Administration in XML::Compile::Schema
$obj-><B>walkTreeB>(NODE, CODE) See Administration in XML::Compile

DETAILS

See documentation in the base class.

DESCRIPTIONS

See documentation in the base class.

SEE ALSO

This module is part of Geo-GML distribution version 0.16, built on January 05, 2014. 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-2014 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.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GEO::GML (3) 2014-01-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.