Remove private and protected scope from GML methods and members
This commit is contained in:
@@ -73,10 +73,9 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
readFlatCoordinates_(node, objectStack) {
|
||||
readFlatCoordinates(node, objectStack) {
|
||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||
const context = /** @type {import("../xml.js").NodeStackItem} */ (objectStack[0]);
|
||||
const containerSrs = context['srsName'];
|
||||
@@ -106,10 +105,9 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {import("../extent.js").Extent|undefined} Envelope.
|
||||
*/
|
||||
readBox_(node, objectStack) {
|
||||
readBox(node, objectStack) {
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = pushParseAndPop(
|
||||
[null],
|
||||
@@ -129,9 +127,8 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
innerBoundaryIsParser_(node, objectStack) {
|
||||
innerBoundaryIsParser(node, objectStack) {
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(
|
||||
undefined,
|
||||
@@ -151,9 +148,8 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
outerBoundaryIsParser_(node, objectStack) {
|
||||
outerBoundaryIsParser(node, objectStack) {
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(
|
||||
undefined,
|
||||
@@ -260,9 +256,8 @@ class GML2 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/LineString.js").default} geometry LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||
writeCurveOrLineString(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const srsName = context['srsName'];
|
||||
if (node.nodeName !== 'LineStringSegment' && srsName) {
|
||||
@@ -286,13 +281,12 @@ class GML2 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||
writeLineStringOrCurveMember(node, line, objectStack) {
|
||||
const child = this.GEOMETRY_NODE_FACTORY_(line, objectStack);
|
||||
if (child) {
|
||||
node.appendChild(child);
|
||||
this.writeCurveOrLineString_(child, line, objectStack);
|
||||
this.writeCurveOrLineString(child, line, objectStack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,9 +294,8 @@ class GML2 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/MultiLineString.js").default} geometry MultiLineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||
writeMultiCurveOrLineString(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const hasZ = context['hasZ'];
|
||||
const srsName = context['srsName'];
|
||||
@@ -313,7 +306,7 @@ class GML2 extends GMLBase {
|
||||
const lines = geometry.getLineStrings();
|
||||
pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName, curve: curve},
|
||||
this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
|
||||
this.LINESTRINGORCURVEMEMBER_SERIALIZERS,
|
||||
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,
|
||||
lines,
|
||||
objectStack,
|
||||
@@ -349,7 +342,7 @@ class GML2 extends GMLBase {
|
||||
pushSerializeAndPop(
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
(item),
|
||||
this.GEOMETRY_SERIALIZERS_,
|
||||
this.GEOMETRY_SERIALIZERS,
|
||||
this.GEOMETRY_NODE_FACTORY_,
|
||||
[value],
|
||||
objectStack,
|
||||
@@ -402,16 +395,15 @@ class GML2 extends GMLBase {
|
||||
writeCurveSegments_(node, line, objectStack) {
|
||||
const child = createElementNS(node.namespaceURI, 'LineStringSegment');
|
||||
node.appendChild(child);
|
||||
this.writeCurveOrLineString_(child, line, objectStack);
|
||||
this.writeCurveOrLineString(child, line, objectStack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/Polygon.js").default} geometry Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
writeSurfaceOrPolygon(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const hasZ = context['hasZ'];
|
||||
const srsName = context['srsName'];
|
||||
@@ -422,7 +414,7 @@ class GML2 extends GMLBase {
|
||||
const rings = geometry.getLinearRings();
|
||||
pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName},
|
||||
this.RING_SERIALIZERS_,
|
||||
this.RING_SERIALIZERS,
|
||||
this.RING_NODE_FACTORY_,
|
||||
rings,
|
||||
objectStack,
|
||||
@@ -465,19 +457,18 @@ class GML2 extends GMLBase {
|
||||
writeSurfacePatches_(node, polygon, objectStack) {
|
||||
const child = createElementNS(node.namespaceURI, 'PolygonPatch');
|
||||
node.appendChild(child);
|
||||
this.writeSurfaceOrPolygon_(child, polygon, objectStack);
|
||||
this.writeSurfaceOrPolygon(child, polygon, objectStack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeRing_(node, ring, objectStack) {
|
||||
writeRing(node, ring, objectStack) {
|
||||
const linearRing = createElementNS(node.namespaceURI, 'LinearRing');
|
||||
node.appendChild(linearRing);
|
||||
this.writeLinearRing_(linearRing, ring, objectStack);
|
||||
this.writeLinearRing(linearRing, ring, objectStack);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -509,9 +500,8 @@ class GML2 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/Point.js").default} geometry Point geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePoint_(node, geometry, objectStack) {
|
||||
writePoint(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const hasZ = context['hasZ'];
|
||||
const srsName = context['srsName'];
|
||||
@@ -529,9 +519,8 @@ class GML2 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/MultiPoint.js").default} geometry MultiPoint geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiPoint_(node, geometry, objectStack) {
|
||||
writeMultiPoint(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const hasZ = context['hasZ'];
|
||||
const srsName = context['srsName'];
|
||||
@@ -541,7 +530,7 @@ class GML2 extends GMLBase {
|
||||
const points = geometry.getPoints();
|
||||
pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName},
|
||||
this.POINTMEMBER_SERIALIZERS_,
|
||||
this.POINTMEMBER_SERIALIZERS,
|
||||
makeSimpleNodeFactory('pointMember'),
|
||||
points,
|
||||
objectStack,
|
||||
@@ -554,21 +543,19 @@ class GML2 extends GMLBase {
|
||||
* @param {Node} node Node.
|
||||
* @param {import("../geom/Point.js").default} point Point geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePointMember_(node, point, objectStack) {
|
||||
writePointMember(node, point, objectStack) {
|
||||
const child = createElementNS(node.namespaceURI, 'Point');
|
||||
node.appendChild(child);
|
||||
this.writePoint_(child, point, objectStack);
|
||||
this.writePoint(child, point, objectStack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/LinearRing.js").default} geometry LinearRing geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLinearRing_(node, geometry, objectStack) {
|
||||
writeLinearRing(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const srsName = context['srsName'];
|
||||
if (srsName) {
|
||||
@@ -583,9 +570,8 @@ class GML2 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/MultiPolygon.js").default} geometry MultiPolygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
writeMultiSurfaceOrPolygon(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const hasZ = context['hasZ'];
|
||||
const srsName = context['srsName'];
|
||||
@@ -596,7 +582,7 @@ class GML2 extends GMLBase {
|
||||
const polygons = geometry.getPolygons();
|
||||
pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName, surface: surface},
|
||||
this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
|
||||
this.SURFACEORPOLYGONMEMBER_SERIALIZERS,
|
||||
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,
|
||||
polygons,
|
||||
objectStack,
|
||||
@@ -609,13 +595,12 @@ class GML2 extends GMLBase {
|
||||
* @param {Node} node Node.
|
||||
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||
writeSurfaceOrPolygonMember(node, polygon, objectStack) {
|
||||
const child = this.GEOMETRY_NODE_FACTORY_(polygon, objectStack);
|
||||
if (child) {
|
||||
node.appendChild(child);
|
||||
this.writeSurfaceOrPolygon_(child, polygon, objectStack);
|
||||
this.writeSurfaceOrPolygon(child, polygon, objectStack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -623,7 +608,6 @@ class GML2 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../extent.js").Extent} extent Extent.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeEnvelope(node, extent, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -636,7 +620,7 @@ class GML2 extends GMLBase {
|
||||
pushSerializeAndPop(
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
({node: node}),
|
||||
this.ENVELOPE_SERIALIZERS_,
|
||||
this.ENVELOPE_SERIALIZERS,
|
||||
OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values,
|
||||
objectStack,
|
||||
@@ -665,41 +649,37 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'coordinates': makeReplacer(GML2.prototype.readFlatCoordinates_),
|
||||
'coordinates': makeReplacer(GML2.prototype.readFlatCoordinates),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML2.prototype.FLAT_LINEAR_RINGS_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'innerBoundaryIs': GML2.prototype.innerBoundaryIsParser_,
|
||||
'outerBoundaryIs': GML2.prototype.outerBoundaryIsParser_,
|
||||
'innerBoundaryIs': GML2.prototype.innerBoundaryIsParser,
|
||||
'outerBoundaryIs': GML2.prototype.outerBoundaryIsParser,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.BOX_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'coordinates': makeArrayPusher(GML2.prototype.readFlatCoordinates_),
|
||||
'coordinates': makeArrayPusher(GML2.prototype.readFlatCoordinates),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML2.prototype.GEOMETRY_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
@@ -710,35 +690,32 @@ GML2.prototype.GEOMETRY_PARSERS = {
|
||||
'LinearRing': makeReplacer(GMLBase.prototype.readLinearRing),
|
||||
'Polygon': makeReplacer(GMLBase.prototype.readPolygon),
|
||||
'MultiPolygon': makeReplacer(GMLBase.prototype.readMultiPolygon),
|
||||
'Box': makeReplacer(GML2.prototype.readBox_),
|
||||
'Box': makeReplacer(GML2.prototype.readBox),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
GML2.prototype.GEOMETRY_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Curve': makeChildAppender(GML2.prototype.writeCurveOrLineString_),
|
||||
'MultiCurve': makeChildAppender(
|
||||
GML2.prototype.writeMultiCurveOrLineString_
|
||||
),
|
||||
'Point': makeChildAppender(GML2.prototype.writePoint_),
|
||||
'MultiPoint': makeChildAppender(GML2.prototype.writeMultiPoint_),
|
||||
'LineString': makeChildAppender(GML2.prototype.writeCurveOrLineString_),
|
||||
'Curve': makeChildAppender(GML2.prototype.writeCurveOrLineString),
|
||||
'MultiCurve': makeChildAppender(GML2.prototype.writeMultiCurveOrLineString),
|
||||
'Point': makeChildAppender(GML2.prototype.writePoint),
|
||||
'MultiPoint': makeChildAppender(GML2.prototype.writeMultiPoint),
|
||||
'LineString': makeChildAppender(GML2.prototype.writeCurveOrLineString),
|
||||
'MultiLineString': makeChildAppender(
|
||||
GML2.prototype.writeMultiCurveOrLineString_
|
||||
GML2.prototype.writeMultiCurveOrLineString
|
||||
),
|
||||
'LinearRing': makeChildAppender(GML2.prototype.writeLinearRing_),
|
||||
'Polygon': makeChildAppender(GML2.prototype.writeSurfaceOrPolygon_),
|
||||
'LinearRing': makeChildAppender(GML2.prototype.writeLinearRing),
|
||||
'Polygon': makeChildAppender(GML2.prototype.writeSurfaceOrPolygon),
|
||||
'MultiPolygon': makeChildAppender(
|
||||
GML2.prototype.writeMultiSurfaceOrPolygon_
|
||||
GML2.prototype.writeMultiSurfaceOrPolygon
|
||||
),
|
||||
'Surface': makeChildAppender(GML2.prototype.writeSurfaceOrPolygon_),
|
||||
'Surface': makeChildAppender(GML2.prototype.writeSurfaceOrPolygon),
|
||||
'MultiSurface': makeChildAppender(
|
||||
GML2.prototype.writeMultiSurfaceOrPolygon_
|
||||
GML2.prototype.writeMultiSurfaceOrPolygon
|
||||
),
|
||||
'Envelope': makeChildAppender(GML2.prototype.writeEnvelope),
|
||||
},
|
||||
@@ -746,61 +723,56 @@ GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lineStringMember': makeChildAppender(
|
||||
GML2.prototype.writeLineStringOrCurveMember_
|
||||
GML2.prototype.writeLineStringOrCurveMember
|
||||
),
|
||||
'curveMember': makeChildAppender(
|
||||
GML2.prototype.writeLineStringOrCurveMember_
|
||||
GML2.prototype.writeLineStringOrCurveMember
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.RING_SERIALIZERS_ = {
|
||||
GML2.prototype.RING_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'outerBoundaryIs': makeChildAppender(GML2.prototype.writeRing_),
|
||||
'innerBoundaryIs': makeChildAppender(GML2.prototype.writeRing_),
|
||||
'outerBoundaryIs': makeChildAppender(GML2.prototype.writeRing),
|
||||
'innerBoundaryIs': makeChildAppender(GML2.prototype.writeRing),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
GML2.prototype.POINTMEMBER_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'pointMember': makeChildAppender(GML2.prototype.writePointMember_),
|
||||
'pointMember': makeChildAppender(GML2.prototype.writePointMember),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'surfaceMember': makeChildAppender(
|
||||
GML2.prototype.writeSurfaceOrPolygonMember_
|
||||
GML2.prototype.writeSurfaceOrPolygonMember
|
||||
),
|
||||
'polygonMember': makeChildAppender(
|
||||
GML2.prototype.writeSurfaceOrPolygonMember_
|
||||
GML2.prototype.writeSurfaceOrPolygonMember
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
GML2.prototype.ENVELOPE_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lowerCorner': makeChildAppender(writeStringTextNode),
|
||||
'upperCorner': makeChildAppender(writeStringTextNode),
|
||||
|
||||
@@ -113,14 +113,13 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {MultiLineString|undefined} MultiLineString.
|
||||
*/
|
||||
readMultiCurve_(node, objectStack) {
|
||||
readMultiCurve(node, objectStack) {
|
||||
/** @type {Array<LineString>} */
|
||||
const lineStrings = pushParseAndPop(
|
||||
[],
|
||||
this.MULTICURVE_PARSERS_,
|
||||
this.MULTICURVE_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -136,14 +135,13 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {MultiPolygon|undefined} MultiPolygon.
|
||||
*/
|
||||
readMultiSurface_(node, objectStack) {
|
||||
readMultiSurface(node, objectStack) {
|
||||
/** @type {Array<Polygon>} */
|
||||
const polygons = pushParseAndPop(
|
||||
[],
|
||||
this.MULTISURFACE_PARSERS_,
|
||||
this.MULTISURFACE_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -156,31 +154,28 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
curveMemberParser_(node, objectStack) {
|
||||
parseNode(this.CURVEMEMBER_PARSERS_, node, objectStack, this);
|
||||
curveMemberParser(node, objectStack) {
|
||||
parseNode(this.CURVEMEMBER_PARSERS, node, objectStack, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
surfaceMemberParser_(node, objectStack) {
|
||||
parseNode(this.SURFACEMEMBER_PARSERS_, node, objectStack, this);
|
||||
surfaceMemberParser(node, objectStack) {
|
||||
parseNode(this.SURFACEMEMBER_PARSERS, node, objectStack, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||
*/
|
||||
readPatch_(node, objectStack) {
|
||||
readPatch(node, objectStack) {
|
||||
return pushParseAndPop(
|
||||
[null],
|
||||
this.PATCHES_PARSERS_,
|
||||
this.PATCHES_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -190,13 +185,12 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array<number>|undefined} flat coordinates.
|
||||
*/
|
||||
readSegment_(node, objectStack) {
|
||||
readSegment(node, objectStack) {
|
||||
return pushParseAndPop(
|
||||
[null],
|
||||
this.SEGMENTS_PARSERS_,
|
||||
this.SEGMENTS_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -206,10 +200,9 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||
*/
|
||||
readPolygonPatch_(node, objectStack) {
|
||||
readPolygonPatch(node, objectStack) {
|
||||
return pushParseAndPop(
|
||||
[null],
|
||||
this.FLAT_LINEAR_RINGS_PARSERS,
|
||||
@@ -222,10 +215,9 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array<number>|undefined} flat coordinates.
|
||||
*/
|
||||
readLineStringSegment_(node, objectStack) {
|
||||
readLineStringSegment(node, objectStack) {
|
||||
return pushParseAndPop(
|
||||
[null],
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS,
|
||||
@@ -238,9 +230,8 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
interiorParser_(node, objectStack) {
|
||||
interiorParser(node, objectStack) {
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(
|
||||
undefined,
|
||||
@@ -260,9 +251,8 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
exteriorParser_(node, objectStack) {
|
||||
exteriorParser(node, objectStack) {
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(
|
||||
undefined,
|
||||
@@ -282,14 +272,13 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Polygon|undefined} Polygon.
|
||||
*/
|
||||
readSurface_(node, objectStack) {
|
||||
readSurface(node, objectStack) {
|
||||
/** @type {Array<Array<number>>} */
|
||||
const flatLinearRings = pushParseAndPop(
|
||||
[null],
|
||||
this.SURFACE_PARSERS_,
|
||||
this.SURFACE_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -311,14 +300,13 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {LineString|undefined} LineString.
|
||||
*/
|
||||
readCurve_(node, objectStack) {
|
||||
readCurve(node, objectStack) {
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = pushParseAndPop(
|
||||
[null],
|
||||
this.CURVE_PARSERS_,
|
||||
this.CURVE_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -334,14 +322,13 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {import("../extent.js").Extent|undefined} Envelope.
|
||||
*/
|
||||
readEnvelope_(node, objectStack) {
|
||||
readEnvelope(node, objectStack) {
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = pushParseAndPop(
|
||||
[null],
|
||||
this.ENVELOPE_PARSERS_,
|
||||
this.ENVELOPE_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -357,10 +344,9 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
readFlatPos_(node, objectStack) {
|
||||
readFlatPos(node, objectStack) {
|
||||
let s = getAllTextContent(node, false);
|
||||
const re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;
|
||||
/** @type {Array<number>} */
|
||||
@@ -402,10 +388,9 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
readFlatPosList_(node, objectStack) {
|
||||
readFlatPosList(node, objectStack) {
|
||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||
const context = objectStack[0];
|
||||
const containerSrs = context['srsName'];
|
||||
@@ -531,9 +516,8 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/Point.js").default} geometry Point geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePoint_(node, geometry, objectStack) {
|
||||
writePoint(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const srsName = context['srsName'];
|
||||
if (srsName) {
|
||||
@@ -560,7 +544,7 @@ class GML3 extends GMLBase {
|
||||
pushSerializeAndPop(
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
({node: node}),
|
||||
this.ENVELOPE_SERIALIZERS_,
|
||||
this.ENVELOPE_SERIALIZERS,
|
||||
OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values,
|
||||
objectStack,
|
||||
@@ -573,9 +557,8 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/LinearRing.js").default} geometry LinearRing geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLinearRing_(node, geometry, objectStack) {
|
||||
writeLinearRing(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const srsName = context['srsName'];
|
||||
if (srsName) {
|
||||
@@ -610,9 +593,8 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {Polygon} geometry Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
writeSurfaceOrPolygon(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const hasZ = context['hasZ'];
|
||||
const srsName = context['srsName'];
|
||||
@@ -623,7 +605,7 @@ class GML3 extends GMLBase {
|
||||
const rings = geometry.getLinearRings();
|
||||
pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName},
|
||||
this.RING_SERIALIZERS_,
|
||||
this.RING_SERIALIZERS,
|
||||
this.RING_NODE_FACTORY_,
|
||||
rings,
|
||||
objectStack,
|
||||
@@ -641,9 +623,8 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {LineString} geometry LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||
writeCurveOrLineString(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const srsName = context['srsName'];
|
||||
if (node.nodeName !== 'LineStringSegment' && srsName) {
|
||||
@@ -667,9 +648,8 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {MultiPolygon} geometry MultiPolygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
writeMultiSurfaceOrPolygon(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const hasZ = context['hasZ'];
|
||||
const srsName = context['srsName'];
|
||||
@@ -680,7 +660,7 @@ class GML3 extends GMLBase {
|
||||
const polygons = geometry.getPolygons();
|
||||
pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName, surface: surface},
|
||||
this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
|
||||
this.SURFACEORPOLYGONMEMBER_SERIALIZERS,
|
||||
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,
|
||||
polygons,
|
||||
objectStack,
|
||||
@@ -693,9 +673,8 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {import("../geom/MultiPoint.js").default} geometry MultiPoint geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiPoint_(node, geometry, objectStack) {
|
||||
writeMultiPoint(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const srsName = context['srsName'];
|
||||
const hasZ = context['hasZ'];
|
||||
@@ -705,7 +684,7 @@ class GML3 extends GMLBase {
|
||||
const points = geometry.getPoints();
|
||||
pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName},
|
||||
this.POINTMEMBER_SERIALIZERS_,
|
||||
this.POINTMEMBER_SERIALIZERS,
|
||||
makeSimpleNodeFactory('pointMember'),
|
||||
points,
|
||||
objectStack,
|
||||
@@ -718,9 +697,8 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {MultiLineString} geometry MultiLineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||
writeMultiCurveOrLineString(node, geometry, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
const hasZ = context['hasZ'];
|
||||
const srsName = context['srsName'];
|
||||
@@ -731,7 +709,7 @@ class GML3 extends GMLBase {
|
||||
const lines = geometry.getLineStrings();
|
||||
pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName, curve: curve},
|
||||
this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
|
||||
this.LINESTRINGORCURVEMEMBER_SERIALIZERS,
|
||||
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,
|
||||
lines,
|
||||
objectStack,
|
||||
@@ -744,25 +722,23 @@ class GML3 extends GMLBase {
|
||||
* @param {Node} node Node.
|
||||
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeRing_(node, ring, objectStack) {
|
||||
writeRing(node, ring, objectStack) {
|
||||
const linearRing = createElementNS(node.namespaceURI, 'LinearRing');
|
||||
node.appendChild(linearRing);
|
||||
this.writeLinearRing_(linearRing, ring, objectStack);
|
||||
this.writeLinearRing(linearRing, ring, objectStack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Polygon} polygon Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||
writeSurfaceOrPolygonMember(node, polygon, objectStack) {
|
||||
const child = this.GEOMETRY_NODE_FACTORY_(polygon, objectStack);
|
||||
if (child) {
|
||||
node.appendChild(child);
|
||||
this.writeSurfaceOrPolygon_(child, polygon, objectStack);
|
||||
this.writeSurfaceOrPolygon(child, polygon, objectStack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -770,25 +746,23 @@ class GML3 extends GMLBase {
|
||||
* @param {Node} node Node.
|
||||
* @param {import("../geom/Point.js").default} point Point geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePointMember_(node, point, objectStack) {
|
||||
writePointMember(node, point, objectStack) {
|
||||
const child = createElementNS(node.namespaceURI, 'Point');
|
||||
node.appendChild(child);
|
||||
this.writePoint_(child, point, objectStack);
|
||||
this.writePoint(child, point, objectStack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {LineString} line LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||
writeLineStringOrCurveMember(node, line, objectStack) {
|
||||
const child = this.GEOMETRY_NODE_FACTORY_(line, objectStack);
|
||||
if (child) {
|
||||
node.appendChild(child);
|
||||
this.writeCurveOrLineString_(child, line, objectStack);
|
||||
this.writeCurveOrLineString(child, line, objectStack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -801,7 +775,7 @@ class GML3 extends GMLBase {
|
||||
writeSurfacePatches_(node, polygon, objectStack) {
|
||||
const child = createElementNS(node.namespaceURI, 'PolygonPatch');
|
||||
node.appendChild(child);
|
||||
this.writeSurfaceOrPolygon_(child, polygon, objectStack);
|
||||
this.writeSurfaceOrPolygon(child, polygon, objectStack);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -813,7 +787,7 @@ class GML3 extends GMLBase {
|
||||
writeCurveSegments_(node, line, objectStack) {
|
||||
const child = createElementNS(node.namespaceURI, 'LineStringSegment');
|
||||
node.appendChild(child);
|
||||
this.writeCurveOrLineString_(child, line, objectStack);
|
||||
this.writeCurveOrLineString(child, line, objectStack);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -843,7 +817,7 @@ class GML3 extends GMLBase {
|
||||
pushSerializeAndPop(
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
(item),
|
||||
this.GEOMETRY_SERIALIZERS_,
|
||||
this.GEOMETRY_SERIALIZERS,
|
||||
this.GEOMETRY_NODE_FACTORY_,
|
||||
[value],
|
||||
objectStack,
|
||||
@@ -1050,31 +1024,28 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'pos': makeReplacer(GML3.prototype.readFlatPos_),
|
||||
'posList': makeReplacer(GML3.prototype.readFlatPosList_),
|
||||
'pos': makeReplacer(GML3.prototype.readFlatPos),
|
||||
'posList': makeReplacer(GML3.prototype.readFlatPosList),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'interior': GML3.prototype.interiorParser_,
|
||||
'exterior': GML3.prototype.exteriorParser_,
|
||||
'interior': GML3.prototype.interiorParser,
|
||||
'exterior': GML3.prototype.exteriorParser,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML3.prototype.GEOMETRY_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
@@ -1085,115 +1056,106 @@ GML3.prototype.GEOMETRY_PARSERS = {
|
||||
'LinearRing': makeReplacer(GMLBase.prototype.readLinearRing),
|
||||
'Polygon': makeReplacer(GMLBase.prototype.readPolygon),
|
||||
'MultiPolygon': makeReplacer(GMLBase.prototype.readMultiPolygon),
|
||||
'Surface': makeReplacer(GML3.prototype.readSurface_),
|
||||
'MultiSurface': makeReplacer(GML3.prototype.readMultiSurface_),
|
||||
'Curve': makeReplacer(GML3.prototype.readCurve_),
|
||||
'MultiCurve': makeReplacer(GML3.prototype.readMultiCurve_),
|
||||
'Envelope': makeReplacer(GML3.prototype.readEnvelope_),
|
||||
'Surface': makeReplacer(GML3.prototype.readSurface),
|
||||
'MultiSurface': makeReplacer(GML3.prototype.readMultiSurface),
|
||||
'Curve': makeReplacer(GML3.prototype.readCurve),
|
||||
'MultiCurve': makeReplacer(GML3.prototype.readMultiCurve),
|
||||
'Envelope': makeReplacer(GML3.prototype.readEnvelope),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||
GML3.prototype.MULTICURVE_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'curveMember': makeArrayPusher(GML3.prototype.curveMemberParser_),
|
||||
'curveMembers': makeArrayPusher(GML3.prototype.curveMemberParser_),
|
||||
'curveMember': makeArrayPusher(GML3.prototype.curveMemberParser),
|
||||
'curveMembers': makeArrayPusher(GML3.prototype.curveMemberParser),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||
GML3.prototype.MULTISURFACE_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'surfaceMember': makeArrayPusher(GML3.prototype.surfaceMemberParser_),
|
||||
'surfaceMembers': makeArrayPusher(GML3.prototype.surfaceMemberParser_),
|
||||
'surfaceMember': makeArrayPusher(GML3.prototype.surfaceMemberParser),
|
||||
'surfaceMembers': makeArrayPusher(GML3.prototype.surfaceMemberParser),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
GML3.prototype.CURVEMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'LineString': makeArrayPusher(GMLBase.prototype.readLineString),
|
||||
'Curve': makeArrayPusher(GML3.prototype.readCurve_),
|
||||
'Curve': makeArrayPusher(GML3.prototype.readCurve),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
GML3.prototype.SURFACEMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Polygon': makeArrayPusher(GMLBase.prototype.readPolygon),
|
||||
'Surface': makeArrayPusher(GML3.prototype.readSurface_),
|
||||
'Surface': makeArrayPusher(GML3.prototype.readSurface),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SURFACE_PARSERS_ = {
|
||||
GML3.prototype.SURFACE_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'patches': makeReplacer(GML3.prototype.readPatch_),
|
||||
'patches': makeReplacer(GML3.prototype.readPatch),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.CURVE_PARSERS_ = {
|
||||
GML3.prototype.CURVE_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'segments': makeReplacer(GML3.prototype.readSegment_),
|
||||
'segments': makeReplacer(GML3.prototype.readSegment),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||
GML3.prototype.ENVELOPE_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lowerCorner': makeArrayPusher(GML3.prototype.readFlatPosList_),
|
||||
'upperCorner': makeArrayPusher(GML3.prototype.readFlatPosList_),
|
||||
'lowerCorner': makeArrayPusher(GML3.prototype.readFlatPosList),
|
||||
'upperCorner': makeArrayPusher(GML3.prototype.readFlatPosList),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.PATCHES_PARSERS_ = {
|
||||
GML3.prototype.PATCHES_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'PolygonPatch': makeReplacer(GML3.prototype.readPolygonPatch_),
|
||||
'PolygonPatch': makeReplacer(GML3.prototype.readPolygonPatch),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||
GML3.prototype.SEGMENTS_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'LineStringSegment': makeReplacer(GML3.prototype.readLineStringSegment_),
|
||||
'LineStringSegment': makeReplacer(GML3.prototype.readLineStringSegment),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1210,20 +1172,18 @@ GML3.prototype.writeFeatures;
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.RING_SERIALIZERS_ = {
|
||||
GML3.prototype.RING_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'exterior': makeChildAppender(GML3.prototype.writeRing_),
|
||||
'interior': makeChildAppender(GML3.prototype.writeRing_),
|
||||
'exterior': makeChildAppender(GML3.prototype.writeRing),
|
||||
'interior': makeChildAppender(GML3.prototype.writeRing),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
GML3.prototype.ENVELOPE_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lowerCorner': makeChildAppender(writeStringTextNode),
|
||||
'upperCorner': makeChildAppender(writeStringTextNode),
|
||||
@@ -1232,68 +1192,62 @@ GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'surfaceMember': makeChildAppender(
|
||||
GML3.prototype.writeSurfaceOrPolygonMember_
|
||||
GML3.prototype.writeSurfaceOrPolygonMember
|
||||
),
|
||||
'polygonMember': makeChildAppender(
|
||||
GML3.prototype.writeSurfaceOrPolygonMember_
|
||||
GML3.prototype.writeSurfaceOrPolygonMember
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
GML3.prototype.POINTMEMBER_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'pointMember': makeChildAppender(GML3.prototype.writePointMember_),
|
||||
'pointMember': makeChildAppender(GML3.prototype.writePointMember),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lineStringMember': makeChildAppender(
|
||||
GML3.prototype.writeLineStringOrCurveMember_
|
||||
GML3.prototype.writeLineStringOrCurveMember
|
||||
),
|
||||
'curveMember': makeChildAppender(
|
||||
GML3.prototype.writeLineStringOrCurveMember_
|
||||
GML3.prototype.writeLineStringOrCurveMember
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
GML3.prototype.GEOMETRY_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Curve': makeChildAppender(GML3.prototype.writeCurveOrLineString_),
|
||||
'MultiCurve': makeChildAppender(
|
||||
GML3.prototype.writeMultiCurveOrLineString_
|
||||
),
|
||||
'Point': makeChildAppender(GML3.prototype.writePoint_),
|
||||
'MultiPoint': makeChildAppender(GML3.prototype.writeMultiPoint_),
|
||||
'LineString': makeChildAppender(GML3.prototype.writeCurveOrLineString_),
|
||||
'Curve': makeChildAppender(GML3.prototype.writeCurveOrLineString),
|
||||
'MultiCurve': makeChildAppender(GML3.prototype.writeMultiCurveOrLineString),
|
||||
'Point': makeChildAppender(GML3.prototype.writePoint),
|
||||
'MultiPoint': makeChildAppender(GML3.prototype.writeMultiPoint),
|
||||
'LineString': makeChildAppender(GML3.prototype.writeCurveOrLineString),
|
||||
'MultiLineString': makeChildAppender(
|
||||
GML3.prototype.writeMultiCurveOrLineString_
|
||||
GML3.prototype.writeMultiCurveOrLineString
|
||||
),
|
||||
'LinearRing': makeChildAppender(GML3.prototype.writeLinearRing_),
|
||||
'Polygon': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon_),
|
||||
'LinearRing': makeChildAppender(GML3.prototype.writeLinearRing),
|
||||
'Polygon': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon),
|
||||
'MultiPolygon': makeChildAppender(
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon_
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon
|
||||
),
|
||||
'Surface': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon_),
|
||||
'Surface': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon),
|
||||
'MultiSurface': makeChildAppender(
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon_
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon
|
||||
),
|
||||
'Envelope': makeChildAppender(GML3.prototype.writeEnvelope),
|
||||
},
|
||||
|
||||
@@ -36,31 +36,28 @@ GML32.prototype.namespace = 'http://www.opengis.net/gml/3.2';
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML32.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'pos': makeReplacer(GML3.prototype.readFlatPos_),
|
||||
'posList': makeReplacer(GML3.prototype.readFlatPosList_),
|
||||
'pos': makeReplacer(GML3.prototype.readFlatPos),
|
||||
'posList': makeReplacer(GML3.prototype.readFlatPosList),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML32.prototype.FLAT_LINEAR_RINGS_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'interior': GML3.prototype.interiorParser_,
|
||||
'exterior': GML3.prototype.exteriorParser_,
|
||||
'interior': GML3.prototype.interiorParser,
|
||||
'exterior': GML3.prototype.exteriorParser,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML32.prototype.GEOMETRY_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
@@ -71,142 +68,131 @@ GML32.prototype.GEOMETRY_PARSERS = {
|
||||
'LinearRing': makeReplacer(GMLBase.prototype.readLinearRing),
|
||||
'Polygon': makeReplacer(GMLBase.prototype.readPolygon),
|
||||
'MultiPolygon': makeReplacer(GMLBase.prototype.readMultiPolygon),
|
||||
'Surface': makeReplacer(GML32.prototype.readSurface_),
|
||||
'MultiSurface': makeReplacer(GML3.prototype.readMultiSurface_),
|
||||
'Curve': makeReplacer(GML32.prototype.readCurve_),
|
||||
'MultiCurve': makeReplacer(GML3.prototype.readMultiCurve_),
|
||||
'Envelope': makeReplacer(GML32.prototype.readEnvelope_),
|
||||
'Surface': makeReplacer(GML32.prototype.readSurface),
|
||||
'MultiSurface': makeReplacer(GML3.prototype.readMultiSurface),
|
||||
'Curve': makeReplacer(GML32.prototype.readCurve),
|
||||
'MultiCurve': makeReplacer(GML3.prototype.readMultiCurve),
|
||||
'Envelope': makeReplacer(GML32.prototype.readEnvelope),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.MULTICURVE_PARSERS_ = {
|
||||
GML32.prototype.MULTICURVE_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'curveMember': makeArrayPusher(GML3.prototype.curveMemberParser_),
|
||||
'curveMembers': makeArrayPusher(GML3.prototype.curveMemberParser_),
|
||||
'curveMember': makeArrayPusher(GML3.prototype.curveMemberParser),
|
||||
'curveMembers': makeArrayPusher(GML3.prototype.curveMemberParser),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.MULTISURFACE_PARSERS_ = {
|
||||
GML32.prototype.MULTISURFACE_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'surfaceMember': makeArrayPusher(GML3.prototype.surfaceMemberParser_),
|
||||
'surfaceMembers': makeArrayPusher(GML3.prototype.surfaceMemberParser_),
|
||||
'surfaceMember': makeArrayPusher(GML3.prototype.surfaceMemberParser),
|
||||
'surfaceMembers': makeArrayPusher(GML3.prototype.surfaceMemberParser),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
GML32.prototype.CURVEMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'LineString': makeArrayPusher(GMLBase.prototype.readLineString),
|
||||
'Curve': makeArrayPusher(GML3.prototype.readCurve_),
|
||||
'Curve': makeArrayPusher(GML3.prototype.readCurve),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
GML32.prototype.SURFACEMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'Polygon': makeArrayPusher(GMLBase.prototype.readPolygon),
|
||||
'Surface': makeArrayPusher(GML3.prototype.readSurface_),
|
||||
'Surface': makeArrayPusher(GML3.prototype.readSurface),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.SURFACE_PARSERS_ = {
|
||||
GML32.prototype.SURFACE_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'patches': makeReplacer(GML3.prototype.readPatch_),
|
||||
'patches': makeReplacer(GML3.prototype.readPatch),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.CURVE_PARSERS_ = {
|
||||
GML32.prototype.CURVE_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'segments': makeReplacer(GML3.prototype.readSegment_),
|
||||
'segments': makeReplacer(GML3.prototype.readSegment),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.ENVELOPE_PARSERS_ = {
|
||||
GML32.prototype.ENVELOPE_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'lowerCorner': makeArrayPusher(GML3.prototype.readFlatPosList_),
|
||||
'upperCorner': makeArrayPusher(GML3.prototype.readFlatPosList_),
|
||||
'lowerCorner': makeArrayPusher(GML3.prototype.readFlatPosList),
|
||||
'upperCorner': makeArrayPusher(GML3.prototype.readFlatPosList),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.PATCHES_PARSERS_ = {
|
||||
GML32.prototype.PATCHES_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'PolygonPatch': makeReplacer(GML3.prototype.readPolygonPatch_),
|
||||
'PolygonPatch': makeReplacer(GML3.prototype.readPolygonPatch),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.SEGMENTS_PARSERS_ = {
|
||||
GML32.prototype.SEGMENTS_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'LineStringSegment': makeReplacer(GML3.prototype.readLineStringSegment_),
|
||||
'LineStringSegment': makeReplacer(GML3.prototype.readLineStringSegment),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.MULTIPOINT_PARSERS_ = {
|
||||
GML32.prototype.MULTIPOINT_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'pointMember': makeArrayPusher(GMLBase.prototype.pointMemberParser_),
|
||||
'pointMembers': makeArrayPusher(GMLBase.prototype.pointMemberParser_),
|
||||
'pointMember': makeArrayPusher(GMLBase.prototype.pointMemberParser),
|
||||
'pointMembers': makeArrayPusher(GMLBase.prototype.pointMemberParser),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
GML32.prototype.MULTILINESTRING_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'lineStringMember': makeArrayPusher(
|
||||
GMLBase.prototype.lineStringMemberParser_
|
||||
GMLBase.prototype.lineStringMemberParser
|
||||
),
|
||||
'lineStringMembers': makeArrayPusher(
|
||||
GMLBase.prototype.lineStringMemberParser_
|
||||
GMLBase.prototype.lineStringMemberParser
|
||||
),
|
||||
},
|
||||
};
|
||||
@@ -214,32 +200,29 @@ GML32.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
GML32.prototype.MULTIPOLYGON_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'polygonMember': makeArrayPusher(GMLBase.prototype.polygonMemberParser_),
|
||||
'polygonMembers': makeArrayPusher(GMLBase.prototype.polygonMemberParser_),
|
||||
'polygonMember': makeArrayPusher(GMLBase.prototype.polygonMemberParser),
|
||||
'polygonMembers': makeArrayPusher(GMLBase.prototype.polygonMemberParser),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.POINTMEMBER_PARSERS_ = {
|
||||
GML32.prototype.POINTMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'Point': makeArrayPusher(GMLBase.prototype.readFlatCoordinatesFromNode_),
|
||||
'Point': makeArrayPusher(GMLBase.prototype.readFlatCoordinatesFromNode),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
GML32.prototype.LINESTRINGMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'LineString': makeArrayPusher(GMLBase.prototype.readLineString),
|
||||
},
|
||||
@@ -248,9 +231,8 @@ GML32.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
GML32.prototype.POLYGONMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'Polygon': makeArrayPusher(GMLBase.prototype.readPolygon),
|
||||
},
|
||||
@@ -259,30 +241,27 @@ GML32.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GML32.prototype.RING_PARSERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'LinearRing': makeReplacer(GMLBase.prototype.readFlatLinearRing_),
|
||||
'LinearRing': makeReplacer(GMLBase.prototype.readFlatLinearRing),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.RING_SERIALIZERS_ = {
|
||||
GML32.prototype.RING_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'exterior': makeChildAppender(GML3.prototype.writeRing_),
|
||||
'interior': makeChildAppender(GML3.prototype.writeRing_),
|
||||
'exterior': makeChildAppender(GML3.prototype.writeRing),
|
||||
'interior': makeChildAppender(GML3.prototype.writeRing),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
GML32.prototype.ENVELOPE_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'lowerCorner': makeChildAppender(writeStringTextNode),
|
||||
'upperCorner': makeChildAppender(writeStringTextNode),
|
||||
@@ -291,68 +270,62 @@ GML32.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
GML32.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'surfaceMember': makeChildAppender(
|
||||
GML3.prototype.writeSurfaceOrPolygonMember_
|
||||
GML3.prototype.writeSurfaceOrPolygonMember
|
||||
),
|
||||
'polygonMember': makeChildAppender(
|
||||
GML3.prototype.writeSurfaceOrPolygonMember_
|
||||
GML3.prototype.writeSurfaceOrPolygonMember
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
GML32.prototype.POINTMEMBER_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'pointMember': makeChildAppender(GML3.prototype.writePointMember_),
|
||||
'pointMember': makeChildAppender(GML3.prototype.writePointMember),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
GML32.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'lineStringMember': makeChildAppender(
|
||||
GML3.prototype.writeLineStringOrCurveMember_
|
||||
GML3.prototype.writeLineStringOrCurveMember
|
||||
),
|
||||
'curveMember': makeChildAppender(
|
||||
GML3.prototype.writeLineStringOrCurveMember_
|
||||
GML3.prototype.writeLineStringOrCurveMember
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML32.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
GML32.prototype.GEOMETRY_SERIALIZERS = {
|
||||
'http://www.opengis.net/gml/3.2': {
|
||||
'Curve': makeChildAppender(GML3.prototype.writeCurveOrLineString_),
|
||||
'MultiCurve': makeChildAppender(
|
||||
GML3.prototype.writeMultiCurveOrLineString_
|
||||
),
|
||||
'Point': makeChildAppender(GML32.prototype.writePoint_),
|
||||
'MultiPoint': makeChildAppender(GML3.prototype.writeMultiPoint_),
|
||||
'LineString': makeChildAppender(GML3.prototype.writeCurveOrLineString_),
|
||||
'Curve': makeChildAppender(GML3.prototype.writeCurveOrLineString),
|
||||
'MultiCurve': makeChildAppender(GML3.prototype.writeMultiCurveOrLineString),
|
||||
'Point': makeChildAppender(GML32.prototype.writePoint),
|
||||
'MultiPoint': makeChildAppender(GML3.prototype.writeMultiPoint),
|
||||
'LineString': makeChildAppender(GML3.prototype.writeCurveOrLineString),
|
||||
'MultiLineString': makeChildAppender(
|
||||
GML3.prototype.writeMultiCurveOrLineString_
|
||||
GML3.prototype.writeMultiCurveOrLineString
|
||||
),
|
||||
'LinearRing': makeChildAppender(GML3.prototype.writeLinearRing_),
|
||||
'Polygon': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon_),
|
||||
'LinearRing': makeChildAppender(GML3.prototype.writeLinearRing),
|
||||
'Polygon': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon),
|
||||
'MultiPolygon': makeChildAppender(
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon_
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon
|
||||
),
|
||||
'Surface': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon_),
|
||||
'Surface': makeChildAppender(GML3.prototype.writeSurfaceOrPolygon),
|
||||
'MultiSurface': makeChildAppender(
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon_
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon
|
||||
),
|
||||
'Envelope': makeChildAppender(GML3.prototype.writeEnvelope),
|
||||
},
|
||||
|
||||
@@ -347,10 +347,7 @@ class GMLBase extends XMLFeature {
|
||||
* @return {Point|undefined} Point.
|
||||
*/
|
||||
readPoint(node, objectStack) {
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(
|
||||
node,
|
||||
objectStack
|
||||
);
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
return new Point(flatCoordinates, GeometryLayout.XYZ);
|
||||
}
|
||||
@@ -365,7 +362,7 @@ class GMLBase extends XMLFeature {
|
||||
/** @type {Array<Array<number>>} */
|
||||
const coordinates = pushParseAndPop(
|
||||
[],
|
||||
this.MULTIPOINT_PARSERS_,
|
||||
this.MULTIPOINT_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -386,7 +383,7 @@ class GMLBase extends XMLFeature {
|
||||
/** @type {Array<LineString>} */
|
||||
const lineStrings = pushParseAndPop(
|
||||
[],
|
||||
this.MULTILINESTRING_PARSERS_,
|
||||
this.MULTILINESTRING_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -405,7 +402,7 @@ class GMLBase extends XMLFeature {
|
||||
/** @type {Array<Polygon>} */
|
||||
const polygons = pushParseAndPop(
|
||||
[],
|
||||
this.MULTIPOLYGON_PARSERS_,
|
||||
this.MULTIPOLYGON_PARSERS,
|
||||
node,
|
||||
objectStack,
|
||||
this
|
||||
@@ -418,28 +415,25 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
pointMemberParser_(node, objectStack) {
|
||||
parseNode(this.POINTMEMBER_PARSERS_, node, objectStack, this);
|
||||
pointMemberParser(node, objectStack) {
|
||||
parseNode(this.POINTMEMBER_PARSERS, node, objectStack, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
lineStringMemberParser_(node, objectStack) {
|
||||
parseNode(this.LINESTRINGMEMBER_PARSERS_, node, objectStack, this);
|
||||
lineStringMemberParser(node, objectStack) {
|
||||
parseNode(this.LINESTRINGMEMBER_PARSERS, node, objectStack, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
polygonMemberParser_(node, objectStack) {
|
||||
parseNode(this.POLYGONMEMBER_PARSERS_, node, objectStack, this);
|
||||
polygonMemberParser(node, objectStack) {
|
||||
parseNode(this.POLYGONMEMBER_PARSERS, node, objectStack, this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -448,10 +442,7 @@ class GMLBase extends XMLFeature {
|
||||
* @return {LineString|undefined} LineString.
|
||||
*/
|
||||
readLineString(node, objectStack) {
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(
|
||||
node,
|
||||
objectStack
|
||||
);
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
const lineString = new LineString(flatCoordinates, GeometryLayout.XYZ);
|
||||
return lineString;
|
||||
@@ -463,10 +454,9 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array<number>|undefined} LinearRing flat coordinates.
|
||||
*/
|
||||
readFlatLinearRing_(node, objectStack) {
|
||||
readFlatLinearRing(node, objectStack) {
|
||||
const ring = pushParseAndPop(
|
||||
null,
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS,
|
||||
@@ -487,10 +477,7 @@ class GMLBase extends XMLFeature {
|
||||
* @return {LinearRing|undefined} LinearRing.
|
||||
*/
|
||||
readLinearRing(node, objectStack) {
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(
|
||||
node,
|
||||
objectStack
|
||||
);
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
return new LinearRing(flatCoordinates, GeometryLayout.XYZ);
|
||||
}
|
||||
@@ -527,10 +514,9 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
readFlatCoordinatesFromNode_(node, objectStack) {
|
||||
readFlatCoordinatesFromNode(node, objectStack) {
|
||||
return pushParseAndPop(
|
||||
null,
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS,
|
||||
@@ -589,7 +575,6 @@ GMLBase.prototype.namespace = GMLNS;
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GMLBase.prototype.FLAT_LINEAR_RINGS_PARSERS = {
|
||||
'http://www.opengis.net/gml': {},
|
||||
@@ -598,7 +583,6 @@ GMLBase.prototype.FLAT_LINEAR_RINGS_PARSERS = {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GMLBase.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {
|
||||
'http://www.opengis.net/gml': {},
|
||||
@@ -607,7 +591,6 @@ GMLBase.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GMLBase.prototype.GEOMETRY_PARSERS = {
|
||||
'http://www.opengis.net/gml': {},
|
||||
@@ -616,27 +599,25 @@ GMLBase.prototype.GEOMETRY_PARSERS = {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||
GMLBase.prototype.MULTIPOINT_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'pointMember': makeArrayPusher(GMLBase.prototype.pointMemberParser_),
|
||||
'pointMembers': makeArrayPusher(GMLBase.prototype.pointMemberParser_),
|
||||
'pointMember': makeArrayPusher(GMLBase.prototype.pointMemberParser),
|
||||
'pointMembers': makeArrayPusher(GMLBase.prototype.pointMemberParser),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
GMLBase.prototype.MULTILINESTRING_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lineStringMember': makeArrayPusher(
|
||||
GMLBase.prototype.lineStringMemberParser_
|
||||
GMLBase.prototype.lineStringMemberParser
|
||||
),
|
||||
'lineStringMembers': makeArrayPusher(
|
||||
GMLBase.prototype.lineStringMemberParser_
|
||||
GMLBase.prototype.lineStringMemberParser
|
||||
),
|
||||
},
|
||||
};
|
||||
@@ -644,32 +625,29 @@ GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
GMLBase.prototype.MULTIPOLYGON_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'polygonMember': makeArrayPusher(GMLBase.prototype.polygonMemberParser_),
|
||||
'polygonMembers': makeArrayPusher(GMLBase.prototype.polygonMemberParser_),
|
||||
'polygonMember': makeArrayPusher(GMLBase.prototype.polygonMemberParser),
|
||||
'polygonMembers': makeArrayPusher(GMLBase.prototype.polygonMemberParser),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||
GMLBase.prototype.POINTMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Point': makeArrayPusher(GMLBase.prototype.readFlatCoordinatesFromNode_),
|
||||
'Point': makeArrayPusher(GMLBase.prototype.readFlatCoordinatesFromNode),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
GMLBase.prototype.LINESTRINGMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'LineString': makeArrayPusher(GMLBase.prototype.readLineString),
|
||||
},
|
||||
@@ -678,9 +656,8 @@ GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
GMLBase.prototype.POLYGONMEMBER_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Polygon': makeArrayPusher(GMLBase.prototype.readPolygon),
|
||||
},
|
||||
@@ -689,11 +666,10 @@ GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GMLBase.prototype.RING_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'LinearRing': makeReplacer(GMLBase.prototype.readFlatLinearRing_),
|
||||
'LinearRing': makeReplacer(GMLBase.prototype.readFlatLinearRing),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user