Open WPS Platform

ZOO.Format.GML

Read/Write GML.

Inherits from

Properties and Functions

NAME DESCRIPTION
schemaLocation {String} Schema location for a particular minor version.
namespaces {Object} Mapping of namespace aliases to namespace URIs.
defaultPrefix  
collectionName {String} Name of featureCollection element.
featureName {String} Element name for features.
geometryName {String} Name of geometry element.
xy {Boolean} Order of the GML coordinate true:(x,y) or false:(y,x) Changing is not recommended, a new Format should be instantiated.
extractAttributes {Boolean} Could we extract attributes
ZOO.Format.GML Create a new parser for GML.
read Read data from a string, and return a list of features.
parseFeature This function is the core of the GML parsing code in ZOO.
parseGeometry Properties of this object are the functions that parse geometries based on their type.
parseGeometry.point Given a GML node representing a point geometry, create a ZOO point geometry.
parseGeometry.multipoint Given a GML node representing a point geometry, create a ZOO multipoint geometry.
parseGeometry.linestring Given a GML node representing a linestring geometry, create a ZOO linestring geometry.
parseGeometry.polygon Given a GML node representing a polygon geometry, create a ZOO polygon geometry.
parseGeometry.multigeometry Given a GML node representing a multigeometry, create a ZOO geometry collection.
parseAttributes  
parseExtendedData Parse ExtendedData from GML.
write Accept Feature Collection, and return a string.
createFeature Accept an ZOO.Feature, and build a GML node for it.
buildGeometryNode Builds and returns a GML geometry node with the given geometry.
buildGeometry Object containing methods to do the actual geometry node building based on geometry type.
buildGeometry.point Given a ZOO point geometry, create a GML point.
buildGeometry.multipoint Given a ZOO multipoint geometry, create a GML GeometryCollection.
buildGeometry.linestring Given a ZOO linestring geometry, create a GML linestring.
buildGeometry.multilinestring Given a ZOO multilinestring geometry, create a GML GeometryCollection.
buildGeometry.linearring Given a ZOO linearring geometry, create a GML linearring.
buildGeometry.polygon Given a ZOO polygon geometry, create a GML polygon.
buildGeometry.multipolygon Given a ZOO multipolygon geometry, create a GML GeometryCollection.
buildGeometry.collection Given a ZOO geometry collection, create a GML MultiGeometry.
buildCoordinatesNode builds the coordinates XmlNode
schemaLocation
{String} Schema location for a particular minor version.
namespaces
{Object} Mapping of namespace aliases to namespace URIs.

defaultPrefix

collectionName
{String} Name of featureCollection element.
featureName
{String} Element name for features. Default is “sql_statement”.
geometryName
{String} Name of geometry element. Defaults to “geometryProperty”.
xy
{Boolean} Order of the GML coordinate true:(x,y) or false:(y,x) Changing is not recommended, a new Format should be instantiated.
extractAttributes
{Boolean} Could we extract attributes
ZOO.Format.GML

Create a new parser for GML.

Parameters

options {Object} An optional object whose properties will be set on this instance.

read
read: function(data)

Read data from a string, and return a list of features.

Parameters

data {String} data to read/parse.

Returns

{Array(ZOO.Feature)} An array of features.

parseFeature
parseFeature: function(node)

This function is the core of the GML parsing code in ZOO. It creates the geometries that are then attached to the returned feature, and calls parseAttributes() to get attribute data out.

Parameters

node {E4XElement}

Returns

{ZOO.Feature} A vector feature.

parseGeometry
Properties of this object are the functions that parse geometries based on their type.
parseGeometry.point

Given a GML node representing a point geometry, create a ZOO point geometry.

Parameters

node {E4XElement} A GML node.

Returns

{ZOO.Geometry.Point} A point geometry.

parseGeometry.multipoint

Given a GML node representing a multipoint geometry, create a ZOO multipoint geometry.

Parameters

node {E4XElement} A GML node.

Returns

{ZOO.Geometry.Point} A multipoint geometry.

parseGeometry.linestring

Given a GML node representing a linestring geometry, create a ZOO linestring geometry.

Parameters

node {E4XElement} A GML node.

Returns

{ZOO.Geometry.LineString} A linestring geometry.

parseGeometry.multilinestring

Given a GML node representing a multilinestring geometry, create a ZOO multilinestring geometry.

Parameters

node {E4XElement} A GML node.

Returns

{ZOO.Geometry.MultiLineString} A multilinestring geometry.

parseGeometry.polygon

Given a GML node representing a polygon geometry, create a ZOO polygon geometry.

Parameters

node {E4XElement} A GML node.

Returns

{ZOO.Geometry.Polygon} A polygon geometry.

parseGeometry.multipolygon

Given a GML node representing a multipolygon geometry, create a ZOO multipolygon geometry.

Parameters

node {E4XElement} A GML node.

Returns

{ZOO.Geometry.MultiPolygon} A multipolygon geometry.

parseGeometry.envelope

Given a GML node representing an envelope, create a ZOO polygon geometry.

Parameters

node {E4XElement} A GML node.

Returns

{ZOO.Geometry.Polygon} A polygon geometry.

parseAttributes
parseAttributes: function(node)

Parameters

node {E4XElement}

Returns

{Object} An attributes object.

write
write: function(features)

Generate a GML document string given a list of features.

Parameters

features {Array(ZOO.Feature)} List of features to serialize into a string.

Returns

{String} A string representing the GML document.

createFeature
createFeature: function(feature)

Accept an ZOO.Feature, and build a GML node for it.

Parameters

feature {ZOO.Feature} The feature to be built as GML.

Returns

{E4XElement} A node reprensting the feature in GML.

buildGeometryNode
buildGeometryNode: function(geometry)

Parameters

geometry {ZOO.Geometry} The geometry to be built as GML.

Returns

{E4XElement} A node reprensting the geometry in GML.

buildGeometry
Object containing methods to do the actual geometry node building based on geometry type.
buildGeometry.point

Given a ZOO point geometry, create a GML point.

Parameters

geometry {ZOO.Geometry.Point} A point geometry.

Returns

{E4XElement} A GML point node.

buildGeometry.multipoint

Given a ZOO multipoint geometry, create a GML multipoint.

Parameters

geometry {ZOO.Geometry.MultiPoint} A multipoint geometry.

Returns

{E4XElement} A GML multipoint node.

buildGeometry.linestring

Given a ZOO linestring geometry, create a GML linestring.

Parameters

geometry {ZOO.Geometry.LineString} A linestring geometry.

Returns

{E4XElement} A GML linestring node.

buildGeometry.multilinestring

Given a ZOO multilinestring geometry, create a GML multilinestring.

Parameters

geometry {ZOO.Geometry.MultiLineString} A multilinestring geometry.

Returns

{E4XElement} A GML multilinestring node.

buildGeometry.linearring

Given a ZOO linearring geometry, create a GML linearring.

Parameters

geometry {ZOO.Geometry.LinearRing} A linearring geometry.

Returns

{E4XElement} A GML linearring node.

buildGeometry.polygon

Given an ZOO polygon geometry, create a GML polygon.

Parameters

geometry {ZOO.Geometry.Polygon} A polygon geometry.

Returns

{E4XElement} A GML polygon node.

buildGeometry.multipolygon

Given a ZOO multipolygon geometry, create a GML multipolygon.

Parameters

geometry {ZOO.Geometry.MultiPolygon} A multipolygon geometry.

Returns

{E4XElement} A GML multipolygon node.

buildCoordinatesNode
buildCoordinatesNode: function(geometry)

builds the coordinates XmlNode

<gml:coordinates decimal="." cs="," ts=" ">...</gml:coordinates>

Parameters

geometry {ZOO.Geometry}

Returns

{E4XElement} created E4XElement