[348] | 1 | .. _api-zoo-format-gml: |
---|
| 2 | |
---|
| 3 | ZOO.Format.GML |
---|
| 4 | ============== |
---|
| 5 | |
---|
| 6 | Read/Write GML. |
---|
| 7 | |
---|
| 8 | Inherits from |
---|
| 9 | |
---|
| 10 | - :ref:`ZOO.Format <api-zoo-format>` |
---|
| 11 | |
---|
| 12 | Properties and Functions |
---|
| 13 | ------------------------ |
---|
| 14 | |
---|
| 15 | .. list-table:: |
---|
| 16 | :widths: 20 50 |
---|
| 17 | :header-rows: 1 |
---|
| 18 | |
---|
| 19 | * - NAME |
---|
| 20 | - DESCRIPTION |
---|
| 21 | * - :ref:`schemaLocation <schemaLocation>` |
---|
| 22 | - {String} Schema location for a particular minor version. |
---|
| 23 | * - :ref:`namespaces <namespaces>` |
---|
| 24 | - {Object} Mapping of namespace aliases to namespace URIs. |
---|
| 25 | * - :ref:`defaultPrefix <defaultPrefix>` |
---|
| 26 | - |
---|
| 27 | * - :ref:`collectionName <collectionName>` |
---|
| 28 | - {String} Name of featureCollection element. |
---|
| 29 | * - :ref:`featureName <featureName>` |
---|
| 30 | - {String} Element name for features. |
---|
| 31 | * - :ref:`geometryName <geometryName>` |
---|
| 32 | - {String} Name of geometry element. |
---|
| 33 | * - :ref:`xy <xy>` |
---|
| 34 | - {Boolean} Order of the GML coordinate true:(x,y) or false:(y,x) Changing is not recommended, a new Format should be instantiated. |
---|
| 35 | * - :ref:`extractAttributes <extractAttributes>` |
---|
| 36 | - {Boolean} Could we extract attributes |
---|
| 37 | * - :ref:`ZOO.Format.GML <ZOO.Format.GML>` |
---|
| 38 | - Create a new parser for GML. |
---|
| 39 | * - :ref:`read <read>` |
---|
| 40 | - Read data from a string, and return a list of features. |
---|
| 41 | * - :ref:`parseFeature <parseFeature>` |
---|
| 42 | - This function is the core of the GML parsing code in ZOO. |
---|
| 43 | * - :ref:`parseGeometry <parseGeometry>` |
---|
| 44 | - Properties of this object are the functions that parse geometries based on their type. |
---|
| 45 | * - :ref:`parseGeometry.point <parseGeometry.point>` |
---|
| 46 | - Given a GML node representing a point geometry, create a ZOO point geometry. |
---|
| 47 | * - :ref:`parseGeometry.multipoint <parseGeometry.multipoint>` |
---|
| 48 | - Given a GML node representing a point geometry, create a ZOO multipoint geometry. |
---|
| 49 | * - :ref:`parseGeometry.linestring <parseGeometry.linestring>` |
---|
| 50 | - Given a GML node representing a linestring geometry, create a ZOO linestring geometry. |
---|
| 51 | * - :ref:`parseGeometry.polygon <parseGeometry.polygon>` |
---|
| 52 | - Given a GML node representing a polygon geometry, create a ZOO polygon geometry. |
---|
| 53 | * - :ref:`parseGeometry.multigeometry <parseGeometry.multigeometry>` |
---|
| 54 | - Given a GML node representing a multigeometry, create a ZOO geometry collection. |
---|
| 55 | * - :ref:`parseAttributes <parseAttributes>` |
---|
| 56 | - |
---|
| 57 | * - :ref:`parseExtendedData <parseExtendedData>` |
---|
| 58 | - Parse ExtendedData from GML. |
---|
| 59 | * - :ref:`write <write>` |
---|
| 60 | - Accept Feature Collection, and return a string. |
---|
| 61 | * - :ref:`createFeature <createFeature>` |
---|
| 62 | - Accept an ZOO.Feature, and build a GML node for it. |
---|
| 63 | * - :ref:`buildGeometryNode <buildGeometryNode>` |
---|
| 64 | - Builds and returns a GML geometry node with the given geometry. |
---|
| 65 | * - :ref:`buildGeometry <buildGeometry>` |
---|
| 66 | - Object containing methods to do the actual geometry node building based on geometry type. |
---|
| 67 | * - :ref:`buildGeometry.point <buildGeometry.point>` |
---|
| 68 | - Given a ZOO point geometry, create a GML point. |
---|
| 69 | * - :ref:`buildGeometry.multipoint <buildGeometry.multipoint>` |
---|
| 70 | - Given a ZOO multipoint geometry, create a GML GeometryCollection. |
---|
| 71 | * - :ref:`buildGeometry.linestring <buildGeometry.linestring>` |
---|
| 72 | - Given a ZOO linestring geometry, create a GML linestring. |
---|
| 73 | * - :ref:`buildGeometry.multilinestring <buildGeometry.multilinestring>` |
---|
| 74 | - Given a ZOO multilinestring geometry, create a GML GeometryCollection. |
---|
| 75 | * - :ref:`buildGeometry.linearring <buildGeometry.linearring>` |
---|
| 76 | - Given a ZOO linearring geometry, create a GML linearring. |
---|
| 77 | * - :ref:`buildGeometry.polygon <buildGeometry.polygon>` |
---|
| 78 | - Given a ZOO polygon geometry, create a GML polygon. |
---|
| 79 | * - :ref:`buildGeometry.multipolygon <buildGeometry.multipolygon>` |
---|
| 80 | - Given a ZOO multipolygon geometry, create a GML GeometryCollection. |
---|
| 81 | * - :ref:`buildGeometry.collection <buildGeometry.collection>` |
---|
| 82 | - Given a ZOO geometry collection, create a GML MultiGeometry. |
---|
| 83 | * - :ref:`buildCoordinatesNode <buildCoordinatesNode>` |
---|
| 84 | - builds the coordinates XmlNode |
---|
| 85 | |
---|
| 86 | .. _schemaLocation: |
---|
| 87 | |
---|
| 88 | schemaLocation |
---|
| 89 | ``{String}`` Schema location for a particular minor version. |
---|
| 90 | |
---|
| 91 | .. _namespaces: |
---|
| 92 | |
---|
| 93 | namespaces |
---|
| 94 | ``{Object}`` Mapping of namespace aliases to namespace URIs. |
---|
| 95 | |
---|
| 96 | .. _defaultPrefix: |
---|
| 97 | |
---|
| 98 | defaultPrefix |
---|
| 99 | |
---|
| 100 | .. _collectionName: |
---|
| 101 | |
---|
| 102 | collectionName |
---|
| 103 | ``{String}`` Name of featureCollection element. |
---|
| 104 | |
---|
| 105 | .. _featureName: |
---|
| 106 | |
---|
| 107 | featureName |
---|
| 108 | ``{String}`` Element name for features. Default is "sql_statement". |
---|
| 109 | |
---|
| 110 | .. _geometryName: |
---|
| 111 | |
---|
| 112 | geometryName |
---|
| 113 | ``{String}`` Name of geometry element. Defaults to "geometryProperty". |
---|
| 114 | |
---|
| 115 | .. _xy: |
---|
| 116 | |
---|
| 117 | xy |
---|
| 118 | ``{Boolean}`` Order of the GML coordinate true:(x,y) or false:(y,x) Changing is not recommended, a new Format should be instantiated. |
---|
| 119 | |
---|
| 120 | .. _extractAttributes: |
---|
| 121 | |
---|
| 122 | extractAttributes |
---|
| 123 | ``{Boolean}`` Could we extract attributes |
---|
| 124 | |
---|
| 125 | .. _ZOO.Format.GML: |
---|
| 126 | |
---|
| 127 | ZOO.Format.GML |
---|
| 128 | Create a new parser for GML. |
---|
| 129 | |
---|
| 130 | *Parameters* |
---|
| 131 | |
---|
| 132 | ``options {Object}`` An optional object whose properties will be set on this instance. |
---|
| 133 | |
---|
| 134 | .. _read: |
---|
| 135 | |
---|
| 136 | read |
---|
| 137 | :: |
---|
| 138 | |
---|
| 139 | read: function(data) |
---|
| 140 | |
---|
| 141 | Read data from a string, and return a list of features. |
---|
| 142 | |
---|
| 143 | *Parameters* |
---|
| 144 | |
---|
| 145 | ``data {String}`` data to read/parse. |
---|
| 146 | |
---|
| 147 | *Returns* |
---|
| 148 | |
---|
| 149 | :ref:`{Array(ZOO.Feature)} <api-zoo-feature>` An array of features. |
---|
| 150 | |
---|
| 151 | .. _parseFeature: |
---|
| 152 | |
---|
| 153 | parseFeature |
---|
| 154 | :: |
---|
| 155 | |
---|
| 156 | parseFeature: function(node) |
---|
| 157 | |
---|
| 158 | This function is the core of the GML parsing code in ZOO. It creates the geometries |
---|
| 159 | that are then attached to the returned feature, and calls parseAttributes() to get |
---|
| 160 | attribute data out. |
---|
| 161 | |
---|
| 162 | *Parameters* |
---|
| 163 | |
---|
| 164 | ``node {E4XElement}`` |
---|
| 165 | |
---|
| 166 | *Returns* |
---|
| 167 | |
---|
| 168 | :ref:`{ZOO.Feature} <api-zoo-feature>` A vector feature. |
---|
| 169 | |
---|
| 170 | .. _parseGeometry: |
---|
| 171 | |
---|
| 172 | parseGeometry |
---|
| 173 | Properties of this object are the functions that parse geometries based on their type. |
---|
| 174 | |
---|
| 175 | .. _parseGeometry.point: |
---|
| 176 | |
---|
| 177 | parseGeometry.point |
---|
| 178 | Given a GML node representing a point geometry, create a ZOO point geometry. |
---|
| 179 | |
---|
| 180 | *Parameters* |
---|
| 181 | |
---|
| 182 | ``node {E4XElement}`` A GML node. |
---|
| 183 | |
---|
| 184 | *Returns* |
---|
| 185 | |
---|
| 186 | :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` A point geometry. |
---|
| 187 | |
---|
| 188 | .. _parseGeometry.multipoint: |
---|
| 189 | |
---|
| 190 | parseGeometry.multipoint |
---|
| 191 | Given a GML node representing a multipoint geometry, create a ZOO multipoint geometry. |
---|
| 192 | |
---|
| 193 | *Parameters* |
---|
| 194 | |
---|
| 195 | ``node {E4XElement}`` A GML node. |
---|
| 196 | |
---|
| 197 | *Returns* |
---|
| 198 | |
---|
| 199 | :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` A multipoint geometry. |
---|
| 200 | |
---|
| 201 | .. _parseGeometry.linestring: |
---|
| 202 | |
---|
| 203 | parseGeometry.linestring |
---|
| 204 | Given a GML node representing a linestring geometry, create a ZOO linestring geometry. |
---|
| 205 | |
---|
| 206 | *Parameters* |
---|
| 207 | |
---|
| 208 | ``node {E4XElement}`` A GML node. |
---|
| 209 | |
---|
| 210 | *Returns* |
---|
| 211 | |
---|
| 212 | :ref:`{ZOO.Geometry.LineString} <api-zoo-geometry-linestring>` A linestring geometry. |
---|
| 213 | |
---|
| 214 | .. _parseGeometry.multilinestring: |
---|
| 215 | |
---|
| 216 | parseGeometry.multilinestring |
---|
| 217 | Given a GML node representing a multilinestring geometry, create a ZOO multilinestring geometry. |
---|
| 218 | |
---|
| 219 | *Parameters* |
---|
| 220 | |
---|
| 221 | ``node {E4XElement}`` A GML node. |
---|
| 222 | |
---|
| 223 | *Returns* |
---|
| 224 | |
---|
| 225 | :ref:`{ZOO.Geometry.MultiLineString} <api-zoo-geometry-multilinestring>` A multilinestring geometry. |
---|
| 226 | |
---|
| 227 | .. _parseGeometry.polygon: |
---|
| 228 | |
---|
| 229 | parseGeometry.polygon |
---|
| 230 | Given a GML node representing a polygon geometry, create a ZOO polygon geometry. |
---|
| 231 | |
---|
| 232 | *Parameters* |
---|
| 233 | |
---|
| 234 | ``node {E4XElement}`` A GML node. |
---|
| 235 | |
---|
| 236 | *Returns* |
---|
| 237 | |
---|
| 238 | :ref:`{ZOO.Geometry.Polygon} <api-zoo-geometry-polygon>` A polygon geometry. |
---|
| 239 | |
---|
| 240 | .. _parseGeometry.multipolygon: |
---|
| 241 | |
---|
| 242 | parseGeometry.multipolygon |
---|
| 243 | Given a GML node representing a multipolygon geometry, create a ZOO multipolygon geometry. |
---|
| 244 | |
---|
| 245 | *Parameters* |
---|
| 246 | |
---|
| 247 | ``node {E4XElement}`` A GML node. |
---|
| 248 | |
---|
| 249 | *Returns* |
---|
| 250 | |
---|
| 251 | :ref:`{ZOO.Geometry.MultiPolygon} <api-zoo-geometry-multipolygon>` A multipolygon geometry. |
---|
| 252 | |
---|
| 253 | .. _parseGeometry.envelope: |
---|
| 254 | |
---|
| 255 | parseGeometry.envelope |
---|
| 256 | Given a GML node representing an envelope, create a ZOO polygon geometry. |
---|
| 257 | |
---|
| 258 | *Parameters* |
---|
| 259 | |
---|
| 260 | ``node {E4XElement}`` A GML node. |
---|
| 261 | |
---|
| 262 | *Returns* |
---|
| 263 | |
---|
| 264 | :ref:`{ZOO.Geometry.Polygon} <api-zoo-geometry-polygon>` A polygon geometry. |
---|
| 265 | |
---|
| 266 | .. _parseAttributes: |
---|
| 267 | |
---|
| 268 | parseAttributes |
---|
| 269 | :: |
---|
| 270 | |
---|
| 271 | parseAttributes: function(node) |
---|
| 272 | |
---|
| 273 | *Parameters* |
---|
| 274 | |
---|
| 275 | ``node {E4XElement}`` |
---|
| 276 | |
---|
| 277 | *Returns* |
---|
| 278 | |
---|
| 279 | ``{Object}`` An attributes object. |
---|
| 280 | |
---|
| 281 | .. _write: |
---|
| 282 | |
---|
| 283 | write |
---|
| 284 | :: |
---|
| 285 | |
---|
| 286 | write: function(features) |
---|
| 287 | |
---|
| 288 | Generate a GML document string given a list of features. |
---|
| 289 | |
---|
| 290 | *Parameters* |
---|
| 291 | |
---|
| 292 | ``features`` :ref:`{Array(ZOO.Feature)} <api-zoo-feature>` List of features to serialize into a string. |
---|
| 293 | |
---|
| 294 | *Returns* |
---|
| 295 | |
---|
| 296 | ``{String}`` A string representing the GML document. |
---|
| 297 | |
---|
| 298 | .. _createFeature: |
---|
| 299 | |
---|
| 300 | createFeature |
---|
| 301 | :: |
---|
| 302 | |
---|
| 303 | createFeature: function(feature) |
---|
| 304 | |
---|
| 305 | Accept an ZOO.Feature, and build a GML node for it. |
---|
| 306 | |
---|
| 307 | *Parameters* |
---|
| 308 | |
---|
| 309 | ``feature`` :ref:`{ZOO.Feature} <api-zoo-feature>` The feature to be built as GML. |
---|
| 310 | |
---|
| 311 | *Returns* |
---|
| 312 | |
---|
| 313 | ``{E4XElement}`` A node reprensting the feature in GML. |
---|
| 314 | |
---|
| 315 | .. _buildGeometryNode: |
---|
| 316 | |
---|
| 317 | buildGeometryNode |
---|
| 318 | :: |
---|
| 319 | |
---|
| 320 | buildGeometryNode: function(geometry) |
---|
| 321 | |
---|
| 322 | *Parameters* |
---|
| 323 | |
---|
| 324 | ``geometry`` :ref:`{ZOO.Geometry} <api-zoo-geometry>` The geometry to be built as GML. |
---|
| 325 | |
---|
| 326 | *Returns* |
---|
| 327 | |
---|
| 328 | ``{E4XElement}`` A node reprensting the geometry in GML. |
---|
| 329 | |
---|
| 330 | .. _buildGeometry: |
---|
| 331 | |
---|
| 332 | buildGeometry |
---|
| 333 | Object containing methods to do the actual geometry node building based on geometry type. |
---|
| 334 | |
---|
| 335 | .. _buildGeometry.point: |
---|
| 336 | |
---|
| 337 | buildGeometry.point |
---|
| 338 | Given a ZOO point geometry, create a GML point. |
---|
| 339 | |
---|
| 340 | *Parameters* |
---|
| 341 | |
---|
| 342 | ``geometry`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` A point geometry. |
---|
| 343 | |
---|
| 344 | *Returns* |
---|
| 345 | |
---|
| 346 | ``{E4XElement}`` A GML point node. |
---|
| 347 | |
---|
| 348 | .. _buildGeometry.multipoint: |
---|
| 349 | |
---|
| 350 | buildGeometry.multipoint |
---|
| 351 | Given a ZOO multipoint geometry, create a GML multipoint. |
---|
| 352 | |
---|
| 353 | *Parameters* |
---|
| 354 | |
---|
| 355 | ``geometry`` :ref:`{ZOO.Geometry.MultiPoint} <api-zoo-geometry-multipoint>` A multipoint geometry. |
---|
| 356 | |
---|
| 357 | *Returns* |
---|
| 358 | |
---|
| 359 | ``{E4XElement}`` A GML multipoint node. |
---|
| 360 | |
---|
| 361 | .. _buildGeometry.linestring: |
---|
| 362 | |
---|
| 363 | buildGeometry.linestring |
---|
| 364 | Given a ZOO linestring geometry, create a GML linestring. |
---|
| 365 | |
---|
| 366 | *Parameters* |
---|
| 367 | |
---|
| 368 | ``geometry`` :ref:`{ZOO.Geometry.LineString} <api-zoo-geometry-linestring>` A linestring geometry. |
---|
| 369 | |
---|
| 370 | *Returns* |
---|
| 371 | |
---|
| 372 | ``{E4XElement}`` A GML linestring node. |
---|
| 373 | |
---|
| 374 | .. _buildGeometry.multilinestring: |
---|
| 375 | |
---|
| 376 | buildGeometry.multilinestring |
---|
| 377 | Given a ZOO multilinestring geometry, create a GML multilinestring. |
---|
| 378 | |
---|
| 379 | *Parameters* |
---|
| 380 | |
---|
| 381 | ``geometry`` :ref:`{ZOO.Geometry.MultiLineString} <api-zoo-geometry-multilinestring>` A multilinestring geometry. |
---|
| 382 | |
---|
| 383 | *Returns* |
---|
| 384 | |
---|
| 385 | ``{E4XElement}`` A GML multilinestring node. |
---|
| 386 | |
---|
| 387 | .. _buildGeometry.linearring: |
---|
| 388 | |
---|
| 389 | buildGeometry.linearring |
---|
| 390 | Given a ZOO linearring geometry, create a GML linearring. |
---|
| 391 | |
---|
| 392 | *Parameters* |
---|
| 393 | |
---|
| 394 | ``geometry`` :ref:`{ZOO.Geometry.LinearRing} <api-zoo-geometry-linearring>` A linearring geometry. |
---|
| 395 | |
---|
| 396 | *Returns* |
---|
| 397 | |
---|
| 398 | ``{E4XElement}`` A GML linearring node. |
---|
| 399 | |
---|
| 400 | .. _buildGeometry.polygon: |
---|
| 401 | |
---|
| 402 | buildGeometry.polygon |
---|
| 403 | Given an ZOO polygon geometry, create a GML polygon. |
---|
| 404 | |
---|
| 405 | *Parameters* |
---|
| 406 | |
---|
| 407 | ``geometry`` :ref:`{ZOO.Geometry.Polygon} <api-zoo-geometry-polygon>` A polygon geometry. |
---|
| 408 | |
---|
| 409 | *Returns* |
---|
| 410 | |
---|
| 411 | ``{E4XElement}`` A GML polygon node. |
---|
| 412 | |
---|
| 413 | .. _buildGeometry.multipolygon: |
---|
| 414 | |
---|
| 415 | buildGeometry.multipolygon |
---|
| 416 | Given a ZOO multipolygon geometry, create a GML multipolygon. |
---|
| 417 | |
---|
| 418 | *Parameters* |
---|
| 419 | |
---|
| 420 | ``geometry`` :ref:`{ZOO.Geometry.MultiPolygon} <api-zoo-geometry-multipolygon>` A multipolygon geometry. |
---|
| 421 | |
---|
| 422 | *Returns* |
---|
| 423 | |
---|
| 424 | ``{E4XElement}`` A GML multipolygon node. |
---|
| 425 | |
---|
| 426 | .. _buildCoordinatesNode: |
---|
| 427 | |
---|
| 428 | buildCoordinatesNode |
---|
| 429 | :: |
---|
| 430 | |
---|
| 431 | buildCoordinatesNode: function(geometry) |
---|
| 432 | |
---|
| 433 | builds the coordinates XmlNode |
---|
| 434 | |
---|
| 435 | :: |
---|
| 436 | |
---|
| 437 | <gml:coordinates decimal="." cs="," ts=" ">...</gml:coordinates> |
---|
| 438 | |
---|
| 439 | *Parameters* |
---|
| 440 | |
---|
| 441 | ``geometry`` :ref:`{ZOO.Geometry} <api-zoo-geometry>` |
---|
| 442 | |
---|
| 443 | *Returns* |
---|
| 444 | |
---|
| 445 | ``{E4XElement}`` created E4XElement |
---|
[183] | 446 | |
---|