source: branches/branch-1.4/docs/api/zoo-format.txt @ 719

Last change on this file since 719 was 348, checked in by neteler, 13 years ago

set correctly svn propset

  • Property svn:eol-style set to native
  • Property svn:keywords set to HeadURL Date Author Id Rev
  • Property svn:mime-type set to text/plain
File size: 3.7 KB
Line 
1.. _api-zoo-format:
2
3ZOO.Format
4==========
5
6Base class for format reading/writing a variety of formats.
7
8Properties     
9----------
10
11.. list-table::
12   :widths: 30 50
13   :header-rows: 1
14
15   * - NAME
16     - DESCRIPTION
17   * - :ref:`options <options>`
18     - {Object} A reference to options passed to the constructor.
19   * - :ref:`externalProjection <externalProjection>`
20     - {ZOO.Projection} When passed a externalProjection and internalProjection, the format will reproject the geometries it reads or writes.
21   * - :ref:`internalProjection <internalProjection>`
22     - {ZOO.Projection} When passed a externalProjection and internalProjection, the format will reproject the geometries it reads or writes.
23   * - :ref:`data <data>`
24     - {Object} When keepData is true, this is the parsed string sent to read.
25   * - :ref:`keepData <keepData>`
26     - {Object} Maintain a reference (data) to the most recently read data.   
27     
28Functions       
29---------
30
31.. list-table::
32   :widths: 12 50
33   :header-rows: 1
34
35   * - NAME
36     - DESCRIPTION
37   * - :ref:`ZOO.Format <ZOO.Format>`
38     - Instances of this class are not useful.
39   * - :ref:`destroy <destroy>`
40     - Clean up.
41   * - :ref:`read <read>`
42     - Read data from a string, and return an object whose type depends on the subclass.
43   * - :ref:`data <data>`
44     - {Object} When keepData is true, this is the parsed string sent to read.
45   * - :ref:`write <write>`
46     - Accept an object, and return a string.     
47       
48**Properties**
49
50.. _options:   
51
52options
53  ``{Object}`` A reference to options passed to the constructor.
54 
55.. _externalProjection:   
56
57externalProjection     
58  :ref:`{ZOO.Projection} <api-zoo-projection>` When passed a externalProjection and internalProjection,
59  the format will reproject the geometries it reads or writes. The externalProjection is the projection
60  used by the content which is passed into read or which comes out of write.  In order to reproject,
61  a projection transformation function for the specified projections must be available.  This support
62  is provided via zoo-proj4js.
63
64.. _internalProjection:   
65
66internalProjection     
67  :ref:`{ZOO.Projection} <api-zoo-projection>` When passed a externalProjection and internalProjection,
68  the format will reproject the geometries it reads or writes. The internalProjection is the projection
69  used by the geometries which are returned by read or which are passed into write.  In order to reproject,
70  a projection transformation function for the specified projections must be available.  This support
71  is provided via zoo-proj4js.
72
73.. _data:   
74
75data   
76  ``{Object}`` When :ref:`keepData <keepData>` is true, this is the parsed string sent to :ref:`read <read>`.
77
78.. _keepData:   
79
80keepData       
81  ``{Object}`` Maintain a reference (:ref:`data <data>`) to the most recently read data.  Default is false.
82
83**Functions**
84
85.. _ZOO.Format:   
86
87ZOO.Format     
88  Instances of this class are not useful.  See one of the subclasses.
89
90  *Parameters*
91 
92  ``options {Object}`` An optional object with properties to set on the format
93 
94  *Valid options*
95
96  ``keepData {Boolean}`` If true, upon read, the data property will be set to the parsed object (e.g. the json or xml object).
97
98  *Returns*
99
100  An instance of ZOO.Format
101 
102.. _destroy:     
103 
104destroy
105  ::
106 
107    destroy: function()
108
109  Clean up.
110
111.. _read:     
112 
113read   
114  ::
115 
116    read: function(data)
117
118  Read data from a string, and return an object whose type depends on the subclass.
119
120  *Parameters*
121 
122  ``data {string}`` Data to read/parse.
123
124  *Returns*
125
126  Depends on the subclass
127
128.. _write:     
129
130write   
131  ::
132 
133    write: function(data)
134
135  Accept an object, and return a string.   
136
137  *Parameters*
138 
139  ``object {Object}`` Object to be serialized
140 
141  *Returns*
142
143  ``{String}`` A string representation of the object. 
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png