Treat WKT EMPTY geometries properly
Empty points have NaN as each coordinate, other geometry types have empty arrays.
This commit is contained in:
@@ -858,7 +858,14 @@ Parser.prototype.parseGeometry_ = function() {
|
||||
if (!parser || !ctor) {
|
||||
throw new Error('Invalid geometry type: ' + geomType);
|
||||
}
|
||||
const coordinates = parser.call(this);
|
||||
let coordinates = parser.call(this);
|
||||
if (!coordinates) {
|
||||
if (ctor === GeometryConstructor[GeometryType.POINT]) {
|
||||
coordinates = [NaN, NaN];
|
||||
} else {
|
||||
coordinates = [];
|
||||
}
|
||||
}
|
||||
return new ctor(coordinates, this.layout_);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user