Changeset 174


Ignore:
Timestamp:
Apr 19, 2011, 11:09:59 PM (9 years ago)
Author:
jmckenna
Message:

add missing function details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/api/zoo-format-geojson.txt

    r167 r174  
    112112ZOO.Format.GeoJSON     
    113113  Create a new parser for GeoJSON.
     114
     115
     116  *Parameters*
     117
     118  ``options {Object}`` An optional object whose properties will be set on this instance.
    114119 
    115120.. _read:                           
    116121 
    117122read   
     123  ::
     124 
     125    read: function(json,type,filter)
     126
    118127  Deserialize a GeoJSON string.
     128
     129  *Parameters*
     130
     131  | ``json {String}`` A GeoJSON string
     132  | ``type {String}`` Optional string that determines the structure of the output.  Supported values are "Geometry", "Feature", and "FeatureCollection".  If absent or null, a default of "FeatureCollection" is assumed.
     133  | ``filter {Function}`` A function which will be called for every key and value at every level of the final result.  Each value will be replaced by the result of the filter function.  This can be used to reform generic objects into instances of classes, or to transform date strings into Date objects.
     134
     135  *Returns*
     136
     137  ``{Object}`` The return depends on the value of the type argument.  If type is "FeatureCollection" (the default),
     138  the return will be an array of :ref:`ZOO.Feature <api-zoo-feature>`.  If type is "Geometry", the input json must
     139  represent a single geometry, and the return will be an :ref:`ZOO.Geometry <api-zoo-geometry>`.  If type
     140  is "Feature", the input json must represent a single feature, and the return will be an :ref:`ZOO.Feature <api-zoo-feature>`.
    119141 
    120142.. _isValidType:                             
    121143 
    122144isValidType     
     145  ::
     146 
     147    isValidType: function(obj,type)
     148
    123149  Check if a GeoJSON object is a valid representative of the given type.
     150
     151  *Returns*
     152
     153  ``{Boolean}`` The object is valid GeoJSON object of the given type.
    124154 
    125155.. _parseFeature:                               
    126156 
    127157parseFeature   
    128   Convert a feature object from GeoJSON into an ZOO.Feature.
     158  ::
     159 
     160    parseFeature: function(obj)
     161
     162  Convert a feature object from GeoJSON into a :ref:`ZOO.Feature <api-zoo-feature>`.
     163
     164  *Parameters*
     165 
     166  ``obj {Object}`` An object created from a GeoJSON object
     167
     168  *Returns*
     169
     170  :ref:`{ZOO.Feature} <api-zoo-feature>` A feature. 
    129171 
    130172.. _parseGeometry:                                 
    131173 
    132174parseGeometry   
    133   Convert a geometry object from GeoJSON into an ZOO.Geometry.
     175  ::
     176 
     177    parseGeometry: function(obj)
     178
     179  Convert a geometry object from GeoJSON into a :ref:`ZOO.Geometry <api-zoo-geometry>`.
     180
     181  *Parameters*
     182 
     183  ``obj {Object}`` An object created from a GeoJSON object
     184
     185  *Returns*
     186
     187  :ref:`{ZOO.Geometry} <api-zoo-geometry>` A geometry.
    134188 
    135189**parseCoords Properties**
     
    138192
    139193parseCoords     
    140   Object with properties corresponding to the GeoJSON geometry types.
     194  Object with properties corresponding to the GeoJSON geometry types. Property
     195  values are functions that do the actual parsing.
    141196 
    142197**parseCoords Functions**
     
    145200
    146201parseCoords.point       
    147   Convert a coordinate array from GeoJSON into an ZOO.Geometry.Point.
     202  Convert a coordinate array from GeoJSON into a :ref:`ZOO.Geometry.Point <api-zoo-geometry-point>`.
     203
     204  *Parameters*
     205
     206  ``array {Object}`` The coordinates array from the GeoJSON fragment.
     207
     208  *Returns*
     209
     210  :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` A geometry.
    148211 
    149212.. _parseCoords.multipoint:                                   
    150213 
    151214parseCoords.multipoint 
    152   Convert a coordinate array from GeoJSON into an ZOO.Geometry.MultiPoint.
     215  Convert a coordinate array from GeoJSON into a :ref:`ZOO.Geometry.MultiPoint <api-zoo-geometry-multipoint>`.
     216
     217  *Parameters*
     218 
     219  ``array {Object}`` The coordinates array from the GeoJSON fragment.
     220
     221  *Returns*
     222
     223  :ref:`{ZOO.Geometry.MultiPoint} <api-zoo-geometry-multipoint>` A geometry.
    153224 
    154225.. _parseCoords.linestring:                                     
    155226 
    156227parseCoords.linestring 
    157   Convert a coordinate array from GeoJSON into an ZOO.Geometry.LineString.
     228  Convert a coordinate array from GeoJSON into a :ref:`ZOO.Geometry.LineString <api-zoo-geometry-linestring>`.
     229
     230  *Parameters*
     231 
     232  ``array {Object}`` The coordinates array from the GeoJSON fragment.
     233 
     234  *Returns*
     235
     236  :ref:`{ZOO.Geometry.LineString} <api-zoo-geometry-linestring>` A geometry.
    158237 
    159238.. _parseCoords.multilinestring:
    160239 
    161240parseCoords.multilinestring     
    162   Convert a coordinate array from GeoJSON into an ZOO.Geometry.MultiLineString.
     241  Convert a coordinate array from GeoJSON into a :ref:`ZOO.Geometry.MultiLineString <api-zoo-geometry-multilinestring>`.
     242
     243  *Parameters*
     244 
     245  ``array {Object}`` The coordinates array from the GeoJSON fragment.
     246
     247  *Returns*
     248
     249  :ref:`{ZOO.Geometry.MultiLineString} <api-zoo-geometry-multilinestring>` A geometry.
    163250 
    164251.. _parseCoords.polygon: 
    165252 
    166253parseCoords.polygon     
    167   Convert a coordinate array from GeoJSON into an ZOO.Geometry.Polygon.
    168 
     254  Convert a coordinate array from GeoJSON into a :ref:`ZOO.Geometry.Polygon <api-zoo-geometry-polygon>`.
     255
     256  *Parameters*
     257 
     258  ``array {Object}`` The coordinates array from the GeoJSON fragment.
     259
     260  *Returns*
     261
     262  :ref:`{ZOO.Geometry.Polygon} <api-zoo-geometry-polygon>` A geometry.
     263 
    169264.. _parseCoords.multipolygon: 
    170265
    171266parseCoords.multipolygon       
    172   Convert a coordinate array from GeoJSON into an ZOO.Geometry.MultiPolygon.
     267  Convert a coordinate array from GeoJSON into a :ref:`ZOO.Geometry.MultiPolygon <api-zoo-geometry-multipolygon>`.
     268 
     269  *Parameters*
     270
     271  ``array {Object}`` The coordinates array from the GeoJSON fragment.
     272
     273  *Returns*
     274
     275  :ref:`{ZOO.Geometry.MultiPolygon} <api-zoo-geometry-multipolygon>` A geometry. 
    173276 
    174277.. _parseCoords.box: 
    175278 
    176279parseCoords.box
    177   Convert a coordinate array from GeoJSON into an ZOO.Geometry.Polygon.
     280  Convert a coordinate array from GeoJSON into a :ref:`ZOO.Geometry.Polygon <api-zoo-geometry-polygon>`.
     281
     282  *Parameters*
     283 
     284  ``array {Object}`` The coordinates array from the GeoJSON fragment.
     285
     286  *Returns*
     287
     288  :ref:`{ZOO.Geometry.Polygon} <api-zoo-geometry-polygon>` A geometry. 
    178289 
    179290.. _write: 
    180291 
    181292write   
     293  ::
     294 
     295    write: function(obj,pretty)
     296
    182297  Serialize a feature, geometry, array of features into a GeoJSON string.
     298
     299  *Parameters*
     300 
     301  | ``obj {Object}`` A :ref:`{ZOO.Feature} <api-zoo-feature>`, :ref:`{ZOO.Geometry} <api-zoo-geometry>`, or an array of features.
     302  | ``pretty {Boolean}`` Structure the output with newlines and indentation.  Default is false.
     303
     304  *Returns*
     305
     306  ``{String}`` The GeoJSON string representation of the input geometry, features, or array of features.
    183307 
    184308.. _createCRSObject:   
    185309 
    186310createCRSObject
     311  ::
     312 
     313    createCRSObject: function(object)
     314
    187315  Create the CRS object for an object.
    188316 
     317  *Parameters*
     318 
     319  ``object`` :ref:`{ZOO.Feature} <api-zoo-feature>`
     320
     321  *Returns*
     322
     323  ``{Object}`` An object which can be assigned to the crs property of a GeoJSON object.
     324 
    189325**extract Properties**
    190326
     
    192328
    193329extract
    194   Object with properties corresponding to the GeoJSON types.
     330  Object with properties corresponding to the GeoJSON types. Property values are
     331  functions that do the actual value extraction.
    195332 
    196333**extract Functions**
     
    200337extract.feature
    201338  Return a partial GeoJSON object representing a single feature.
     339
     340
     341  *Parameters*
     342 
     343  ``feature`` :ref:`{ZOO.Feature} <api-zoo-feature>`
     344
     345  *Returns*
     346
     347  ``{Object}`` An object representing the point. 
    202348 
    203349.. _extract.geometry:     
     
    205351extract.geometry       
    206352  Return a GeoJSON object representing a single geometry.
     353
     354  *Parameters*
     355 
     356  ``geometry`` :ref:`{ZOO.Geometry} <api-zoo-geometry>`
     357 
     358  *Returns*
     359
     360  ``{Object}`` An object representing the geometry.
    207361 
    208362.. _extract.point:       
     
    210364extract.point   
    211365  Return an array of coordinates from a point.
     366
     367  *Parameters*
     368 
     369  ``point`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>`
     370
     371  *Returns*
     372
     373  ``{Array}`` An array of coordinates representing the point.
    212374 
    213375.. _extract.multipoint:         
     
    215377extract.multipoint     
    216378  Return an array of coordinates from a multipoint.
     379
     380  *Parameters*
     381 
     382  ``multipoint`` :ref:`{ZOO.Geometry.MultiPoint} <api-zoo-geometry-multipoint>`
     383
     384  *Returns*
     385
     386  ``{Array}`` An array of point coordinate arrays representing the multipoint.
    217387 
    218388.. _extract.linestring:           
     
    220390extract.linestring     
    221391  Return an array of coordinate arrays from a linestring.
     392
     393  *Parameters*
     394 
     395  ``linestring`` :ref:`{ZOO.Geometry.LineString} <api-zoo-geometry-linestring>`
     396
     397  *Returns*
     398
     399  ``{Array}`` An array of coordinate arrays representing the linestring.
    222400 
    223401.. _extract.multilinestring:             
     
    225403extract.multilinestring
    226404  Return an array of linestring arrays from a linestring.
     405
     406  *Parameters*
     407 
     408  ``multilinestring`` :ref:`{ZOO.Geometry.MultiLineString} <api-zoo-geometry-multilinestring>`
     409
     410  *Returns*
     411
     412  ``{Array}`` An array of linestring arrays representing the multilinestring.
    227413 
    228414.. _extract.polygon:             
     
    230416extract.polygon
    231417  Return an array of linear ring arrays from a polygon.
     418
     419  *Parameters*
     420 
     421  ``polygon`` :ref:`{ZOO.Geometry.Polygon} <api-zoo-geometry-polygon>`
     422 
     423  *Returns*
     424
     425  ``{Array}`` An array of linear ring arrays representing the polygon.
    232426 
    233427.. _extract.multipolygon:                 
     
    236430  Return an array of polygon arrays from a multipolygon.
    237431 
     432  *Parameters*
     433 
     434  ``multipolygon`` :ref:`{ZOO.Geometry.MultiPolygon} <api-zoo-geometry-multipolygon>`
     435
     436  *Returns*
     437
     438  ``{Array}`` An array of polygon arrays representing the multipolygon 
     439 
    238440.. _extract.collection: 
    239441 
    240442extract.collection     
    241443  Return an array of geometries from a geometry collection.
     444
     445  *Parameters*
     446
     447  ``collection`` :ref:`{ZOO.Geometry.Collection} <api-zoo-geometry-collection>`
     448
     449  *Returns*
     450
     451  ``{Array}`` An array of geometry objects representing the geometry collection.
Note: See TracChangeset for help on using the changeset viewer.

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