#include "module.h"
#include <yandex/maps/wiki/validator/check.h>
#include <yandex/maps/wiki/validator/categories.h>

#include "../utils/face_checks.h"
#include "../utils/polygon_checks.h"

using maps::wiki::validator::categories::URBAN;
using maps::wiki::validator::categories::URBAN_FC;
using maps::wiki::validator::categories::URBAN_EL;
using maps::wiki::validator::categories::URBAN_AREAL;

namespace maps {
namespace wiki {
namespace validator {
namespace checks {

namespace {

const size_t VISIT_BATCH_SIZE = 10000;

} // namespace

VALIDATOR_CHECK_PART( urban_geometry, contour_geometry, URBAN, URBAN_FC, URBAN_EL )
{
    utils::runFaceIntersectionsNestingCheck<URBAN>(context);
}

VALIDATOR_CHECK_PART( urban_geometry, polygon_geometry, URBAN_AREAL )
{
    context->objects<URBAN_AREAL>().batchVisit(
            [&](const PolygonFeature* urban)
    {
        utils::runPolygonGeometryCheck(urban, context);
    }, VISIT_BATCH_SIZE);
}

} // namespace checks
} // namespace validator
} // namespace wiki
} // namespace maps
