Skip to content

Commit

Permalink
Merge pull request #336 from wri/feat/TM-1089-polygon-validation
Browse files Browse the repository at this point in the history
[TM-1089] add coordinate system validation
  • Loading branch information
cesarLima1 authored Jul 9, 2024
2 parents c5278b2 + 9721ba5 commit ab9e3d2
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use App\Services\PolygonService;
use App\Services\SiteService;
use App\Validators\Extensions\Polygons\EstimatedArea;
use App\Validators\Extensions\Polygons\FeatureBounds;
use App\Validators\Extensions\Polygons\GeometryType;
use App\Validators\Extensions\Polygons\NotOverlapping;
use App\Validators\Extensions\Polygons\PolygonSize;
Expand Down Expand Up @@ -376,6 +377,17 @@ public function validateEstimatedArea(Request $request)
);
}

public function validateCoordinateSystem(Request $request)
{
$uuid = $request->input('uuid');

return $this->handlePolygonValidation(
$uuid,
['valid' => FeatureBounds::uuidValid($uuid)],
PolygonService::COORDINATE_SYSTEM_CRITERIA_ID
);
}

public function getPolygonAsGeoJSONDownload(Request $request)
{
try {
Expand Down Expand Up @@ -508,6 +520,7 @@ public function runValidationPolygon(string $uuid)

$this->validateOverlapping($request);
$this->checkSelfIntersection($request);
$this->validateCoordinateSystem($request);
$this->validatePolygonSize($request);
$this->checkWithinCountry($request);
$this->checkBoundarySegments($request);
Expand Down

0 comments on commit ab9e3d2

Please sign in to comment.