Get projection and axis order from GML data

To make tests pass, the winding order of the coordinates in the
test data had to be reversed to conform to common gml practice.
This commit is contained in:
ahocevar
2013-07-24 22:42:49 +02:00
parent 109ec71877
commit 56e8b1cfb4
8 changed files with 102 additions and 28 deletions
+3 -3
View File
@@ -101,7 +101,7 @@ ol.parser.ogc.GML_v3 = function(opt_options) {
this.regExes.trimSpace, '');
var coords = goog.array.map(str.split(this.regExes.splitSpace),
parseFloat);
if (this.axisOrientation.substr(0, 2) === 'en') {
if (this.getAxisOrientation().substr(0, 2) === 'en') {
obj.push([coords]);
} else {
if (coords.length === 2) {
@@ -125,7 +125,7 @@ ol.parser.ogc.GML_v3 = function(opt_options) {
for (var i = 0, ii = coords.length; i < ii; i += dim) {
x = parseFloat(coords[i]);
y = parseFloat(coords[i + 1]);
var xy = this.axisOrientation.substr(0, 2) === 'en';
var xy = this.getAxisOrientation().substr(0, 2) === 'en';
if (dim === 3) {
if (xy) {
points[i / dim] = [x, y, parseFloat(coords[i + 2])];
@@ -393,7 +393,7 @@ ol.parser.ogc.GML_v3 = function(opt_options) {
'upperCorner': function(bounds) {
// only 2d for simple features profile
var pos;
if (this.axisOrientation.substr(0, 2) === 'en') {
if (this.axisOrientation().substr(0, 2) === 'en') {
pos = (bounds.right + ' ' + bounds.top);
} else {
pos = (bounds.top + ' ' + bounds.right);