PHP Class Location\PolygonTest

Inheritance: extends PHPUnit_Framework_TestCase
Datei anzeigen Open project: mjaschen/phpgeo

Public Methods

Method Description
testGetReverseWorksAsExpected ( )
testIfAddPointsWorksAsExpected ( )
testIfContainsPointCheckWithLatitudeSignSwitchWorksAsExpected ( )
testIfContainsPointCheckWithLongitudeSignSwitchWorksAsExpected ( )
testIfContainsPointCheckWorksAsExpected ( )
testIfGetLatsWorksAsExpected ( )
testIfGetLngsWorksAsExpected ( )
testIfGetNumberOfPointsWorksAsExpected ( )
testIfGetSegmentsWorksAsExpected ( )
testIfNotContainsPointCheckWithWorksAsExpected ( )
testIfPerimeterCalculationWorksAsExpected ( ) * public function testIfContainsPointCheckWithLongitudesCrossingThe180thMeridianWorksAsExpected() { $polygon = new Polygon(); $polygon->addPoint(new Coordinate(10, 150)); $polygon->addPoint(new Coordinate(10, -150)); $polygon->addPoint(new Coordinate(30, -150)); $polygon->addPoint(new Coordinate(30, 150));
testIfPolygonContainsGeometryWithLineInsideAndOutsideWorksAsExpected ( )
testIfPolygonContainsGeometryWithLineInsideWorksAsExpected ( )
testIfPolygonContainsGeometryWithLineOutsideWorksAsExpected ( )
testIfPolygonContainsGeometryWithPointInsideWorksAsExpected ( )
testIfPolygonContainsGeometryWithPointOutsideWorksAsExpected ( )
testIfPolygonContainsGeometryWithPolygonInsideAndOutsideWorksAsExpected ( )
testIfPolygonContainsGeometryWithPolygonInsideWorksAsExpected ( ) * public function testIfAreaCalculationWorksAsExpected() { $polygon = new Polygon(); $polygon->addPoint(new Coordinate(52, 13)); $polygon->addPoint(new Coordinate(53, 13)); $polygon->addPoint(new Coordinate(53, 12)); $polygon->addPoint(new Coordinate(52, 12));
testIfPolygonContainsGeometryWithPolygonOutsideWorksAsExpected ( )
testIfPolygonContainsGeometryWithPolylineInsideAndOutsideWorksAsExpected ( )
testIfPolygonContainsGeometryWithPolylineInsideWorksAsExpected ( )
testIfPolygonContainsGeometryWithPolylineOutsideWorksAsExpected ( )
testReverseTwiceWorksAsExpected ( )

Method Details

testGetReverseWorksAsExpected() public method

testIfAddPointsWorksAsExpected() public method

testIfContainsPointCheckWithLatitudeSignSwitchWorksAsExpected() public method

testIfContainsPointCheckWithLongitudeSignSwitchWorksAsExpected() public method

testIfContainsPointCheckWorksAsExpected() public method

testIfGetLatsWorksAsExpected() public method

testIfGetLngsWorksAsExpected() public method

testIfGetNumberOfPointsWorksAsExpected() public method

testIfGetSegmentsWorksAsExpected() public method

testIfNotContainsPointCheckWithWorksAsExpected() public method

testIfPerimeterCalculationWorksAsExpected() public method

$point = new Coordinate(20, 160); $this->assertTrue($polygon->contains($point)); $point = new Coordinate(20, -160); $this->assertTrue($polygon->contains($point)); }

testIfPolygonContainsGeometryWithLineInsideAndOutsideWorksAsExpected() public method

testIfPolygonContainsGeometryWithLineInsideWorksAsExpected() public method

testIfPolygonContainsGeometryWithLineOutsideWorksAsExpected() public method

testIfPolygonContainsGeometryWithPointInsideWorksAsExpected() public method

testIfPolygonContainsGeometryWithPointOutsideWorksAsExpected() public method

testIfPolygonContainsGeometryWithPolygonInsideAndOutsideWorksAsExpected() public method

testIfPolygonContainsGeometryWithPolygonInsideWorksAsExpected() public method

http://geographiclib.sourceforge.net/cgi-bin/Planimeter?type=polygon&rhumb=geodesic&input=52.00000000000000000+13.00000000000000000%0D%0A53.00000000000000000+13.00000000000000000%0D%0A53.00000000000000000+12.00000000000000000%0D%0A52.00000000000000000+12.00000000000000000&norm=decdegrees&option=Submit $this->assertEquals(7556565706.2, $polygon->getArea(), 0.01); }

testIfPolygonContainsGeometryWithPolygonOutsideWorksAsExpected() public method

testIfPolygonContainsGeometryWithPolylineInsideAndOutsideWorksAsExpected() public method

testIfPolygonContainsGeometryWithPolylineInsideWorksAsExpected() public method

testIfPolygonContainsGeometryWithPolylineOutsideWorksAsExpected() public method

testReverseTwiceWorksAsExpected() public method