recursiveShapeValidation(allowedShapes, shape, errorMessages) {
    if (!this.checkStructure(allowedShapes, shape, errorMessages)) {
      return false;
    }

    const isMulti = multiTypes.indexOf(shape.type) !== -1;
    let coordinateValidation,
      result = true;

    switch (shape.type) {
      case "point":
      case "multipoint":
        coordinateValidation = isPoint;
        break;
      case "linestring":
      case "multilinestring":
        coordinateValidation = isLine;
        break;
      case "polygon":
      case "multipolygon":
        coordinateValidation = isPolygon;
        if (
          shape.orientation &&
          !allowedOrientations.includes(shape.orientation)
        ) {
          errorMessages.push("The orientation property has not a valid value.");
          result = false;
        }
        break;
      case "geometrycollection":
        coordinateValidation = () => true;

        for (let i = 0; i < shape.geometries.length; i++) {
          if (
            !this.recursiveShapeValidation(
              allowedShapes,
              shape.geometries[i],
              errorMessages,
            )
          ) {
            result = false;
          }
        }
        break;
      case "envelope":
        coordinateValidation = isEnvelope;
        break;
      case "circle":
        coordinateValidation = isPoint;
        if (typeof shape.radius === "string") {
          try {
            if (typeof Koncorde.convertDistance(shape.radius) !== "number") {
              errorMessages.push("The radius property has not a valid format.");
              result = false;
            }
          } catch (error) {
            errorMessages.push("The radius property has not a valid format.");
            result = false;
          }
        } else if (typeof shape.radius !== "number") {
          errorMessages.push("The radius property has not a valid format.");
          result = false;
        }
        break;
      default:
        // added to comply with sonarqube
        // but it's currently not possible to get here
        errorMessages.push(`Unrecognized shape: ${shape.type}`);
        result = false;
    }

    if (isMulti) {
      if (
        shape.coordinates.some(
          (coordinate) => !coordinateValidation(coordinate),
        )
      ) {
        errorMessages.push(
          `One of the shapes in  the shape type "${shape.type}" has bad coordinates.`,
        );
        result = false;
      }
    } else if (!coordinateValidation(shape.coordinates)) {
      errorMessages.push(`The shape type "${shape.type}" has bad coordinates.`);
      return false;
    }

    return result;
  }
@param {string[]} allowedShapes
@param {GeoShape} shape
@param {string[]} errorMessages
@returns {boolean}