Skip to content

Commit

Permalink
Added Surface tests for CurvePolygon
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Apr 12, 2015
1 parent 35876cd commit 8366a33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ final protected function skipIfUnsupportedGeometry(Geometry $geometry)
}
}

if ($geometry instanceof CircularString || $geometry instanceof CompoundCurve) {
if ($geometry instanceof CircularString || $geometry instanceof CompoundCurve || $geometry instanceof CurvePolygon) {
if ($this->isGEOS() || $this->isSpatiaLite() || $this->isMySQL() || $this->isMariaDB()) {
// GEOS, SpatiaLite, MySQL and MariaDB do not support CircularString and CompoundCurve.
// GEOS, SpatiaLite, MySQL and MariaDB do not support these geometries.
// Only PostGIS currently supports these.
$this->setExpectedException(GeometryException::class);
}
}
Expand Down
8 changes: 8 additions & 0 deletions tests/SurfaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function providerArea()
['POLYGON ((1 1, 1 9, 9 1, 1 1))', 32],
['POLYGON ((1 1, 1 9, 9 1, 1 1), (2 4, 2 5, 4 5, 4 4, 2 4))', 30],
['POLYGON ((1 1, 1 9, 9 1, 1 1), (2 4, 2 5, 4 5, 4 4, 2 4), (2 2, 2 3, 3 3, 3 2, 2 2))', 29],

['POLYGON ((1 3, 3 5, 4 7, 7 3, 1 3))', 11],
['CURVEPOLYGON ((1 3, 3 5, 4 7, 7 3, 1 3))', 11],
['CURVEPOLYGON (CIRCULARSTRING (1 3, 3 5, 4 7, 7 3, 1 3))', 24.951],
];
}

Expand All @@ -61,6 +65,8 @@ public function providerCentroid()
return [
['POLYGON ((1 2, 1 3, 2 3, 2 4, 3 4, 3 3, 4 3, 4 2, 3 2, 3 1, 2 1, 2 2, 1 2))', 'POINT (2.5 2.5)'],
['POLYGON ((0 0, 0 3, 3 3, 3 0, 0 0), (1 1, 1 2, 2 2, 2 1, 1 1))', 'POINT (1.5 1.5)'],

// Note: centroid() on CurvePolygon is not currently supported by any geometry engine.
];
}

Expand Down Expand Up @@ -94,6 +100,8 @@ public function providerPointOnSurface()
['POLYGON ((1 1, 1 3, 4 3, 4 6, 6 6, 6 1, 1 1))'],
['POLYGON ((0 0, 0 4, 3 4, 3 3, 4 3, 4 0, 0 0))'],
['POLYGON ((0 0, 0 3, 3 3, 3 0, 0 0), (1 1, 1 2, 2 2, 2 1, 1 1))'],

// Note: pointOnSurface() on CurvePolygon is not currently supported by any geometry engine.
];
}
}

0 comments on commit 8366a33

Please sign in to comment.