source: trunk/docs/api/zoo-format-wkt.txt @ 177

Last change on this file since 177 was 176, checked in by jmckenna, 14 years ago

add missing function details

File size: 5.0 KB
Line 
1.. _api-zoo-format-wkt:
2
3ZOO.Format.WKT
4==============
5
6Class for reading and writing Well-Known Text.
7
8Functions and Properties       
9------------------------
10
11.. list-table::
12   :widths: 30 50
13   :header-rows: 1
14
15   * - NAME
16     - DESCRIPTION
17   * - :ref:`ZOO.Format.WKT <ZOO.Format.WKT>`
18     - Create a new parser for WKT
19   * - :ref:`read <read>`
20     - Deserialize a WKT string and return a vector feature or an array of vector features.
21   * - :ref:`write <write>`
22     - Serialize a feature or array of features into a WKT string.
23   * - :ref:`extract <extract>`
24     - Object with properties corresponding to the geometry types.   
25   * - :ref:`parse <parse>`
26     - Object with properties corresponding to the geometry types.
27   * - :ref:`parse.point <parse.point>`
28     - Return point feature given a point WKT fragment.   
29   * - :ref:`parse.multipoint <parse.multipoint>`
30     - Return a multipoint feature given a multipoint WKT fragment.
31   * - :ref:`parse.linestring <parse.linestring>`
32     - Return a linestring feature given a linestring WKT fragment.
33   * - :ref:`parse.multilinestring <parse.multilinestring>`
34     - Return a multilinestring feature given a multilinestring WKT fragment.
35   * - :ref:`parse.polygon <parse.polygon>`
36     - Return a polygon feature given a polygon WKT fragment.
37   * - :ref:`parse.multipolygon <parse.multipolygon>`
38     - Return a multipolygon feature given a multipolygon WKT fragment.
39   * - :ref:`parse.geometrycollection <parse.geometrycollection>`
40     - Return an array of features given a geometrycollection WKT fragment.     
41       
42.. _ZOO.Format.WKT:   
43
44ZOO.Format.WKT 
45  Create a new parser for WKT
46
47  *Parameters*
48 
49  ``options {Object}`` An optional object whose properties will be set on this instance
50
51  *Returns*
52
53  :ref:`{ZOO.Format.WKT} <api-zoo-format-wkt>` A new WKT parser.
54 
55.. _read:     
56 
57read   
58  ::
59 
60    read: function(wkt)
61
62  Deserialize a WKT string and return a vector feature or an array of vector features. 
63  Supports WKT for POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON,
64  and GEOMETRYCOLLECTION.
65 
66  *Parameters*
67 
68  ``wkt {String}`` A WKT string
69 
70  *Returns*
71
72  {<ZOO.Feature.Vector>|Array} A feature or array of features for GEOMETRYCOLLECTION WKT.
73 
74.. _write:       
75 
76write   
77  ::
78 
79    write: function(features)
80
81  Serialize a feature or array of features into a WKT string.
82 
83  *Parameters*
84 
85  ``features {<ZOO.Feature.Vector>|Array}`` A feature or array of features
86
87  *Returns*
88
89  ``{String}`` The WKT string representation of the input geometries
90 
91.. _extract:         
92 
93extract
94  Object with properties corresponding to the geometry types. Property values are
95  functions that do the actual data extraction.
96 
97.. _parse:           
98 
99parse   
100  Object with properties corresponding to the geometry types. Property values are
101  functions that do the actual parsing.
102 
103.. _parse.point:             
104 
105parse.point     
106  Return point feature given a point WKT fragment.
107 
108  *Parameters*
109 
110  ``str {String}`` A WKT fragment representing the point
111 
112  *Returns*
113 
114  :ref:`{ZOO.Feature} <api-zoo-feature>` A point feature 
115 
116.. _parse.multipoint:               
117 
118parse.multipoint       
119  Return a multipoint feature given a multipoint WKT fragment.
120
121  *Parameters*
122 
123  ``str {String}`` A WKT fragment representing the multipoint
124
125  *Returns*
126
127  :ref:`{ZOO.Feature} <api-zoo-feature>` A multipoint feature
128 
129.. _parse.linestring:               
130 
131parse.linestring       
132  Return a linestring feature given a linestring WKT fragment.
133
134  *Parameters*
135 
136  ``str {String}`` A WKT fragment representing the linestring
137
138  *Returns*
139
140  :ref:`{ZOO.Feature} <api-zoo-feature>` A linestring feature
141 
142.. _parse.multilinestring:                 
143 
144parse.multilinestring   
145  Return a multilinestring feature given a multilinestring WKT fragment.
146 
147  *Parameters*
148 
149  ``str {String}`` A WKT fragment representing the multilinestring
150 
151  *Returns*
152
153  :ref:`{ZOO.Feature} <api-zoo-feature>` A multilinestring feature 
154 
155.. _parse.polygon:                 
156 
157parse.polygon   
158  Return a polygon feature given a polygon WKT fragment.
159
160  *Parameters*
161 
162  ``str {String}`` A WKT fragment representing the polygon
163 
164  *Returns*
165
166  :ref:`{ZOO.Feature} <api-zoo-feature>` A polygon feature
167 
168.. _parse.multipolygon:                   
169 
170parse.multipolygon     
171  Return a multipolygon feature given a multipolygon WKT fragment.
172
173  *Parameters*
174 
175  ``str {String}`` A WKT fragment representing the multipolygon
176
177  *Returns*
178
179  :ref:`{ZOO.Feature} <api-zoo-feature>` A multipolygon feature 
180 
181.. _parse.geometrycollection:                     
182 
183parse.geometrycollection       
184  Return an array of features given a geometrycollection WKT fragment.
185
186  *Parameters*
187 
188  ``str {String}`` A WKT fragment representing the geometrycollection
189
190  *Returns*
191
192  ``{Array}`` An array of ZOO.Feature
Note: See TracBrowser for help on using the repository browser.

Search

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