-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,001 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Brick\Geo\Tests\Doctrine\DataFixtures; | ||
|
||
use Brick\Geo\Point; | ||
use Brick\Geo\Tests\Doctrine\Fixtures\GeometryEntity; | ||
use Doctrine\Common\DataFixtures\FixtureInterface; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
|
||
class LoadGeometryData implements FixtureInterface { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
function load(ObjectManager $manager) | ||
{ | ||
$point1 = new GeometryEntity(); | ||
$point1->setGeometry(Point::factory(0, 0)); | ||
|
||
$manager->persist($point1); | ||
$manager->flush(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Brick\Geo\Tests\Doctrine\DataFixtures; | ||
|
||
use Brick\Geo\LineString; | ||
use Brick\Geo\Point; | ||
use Brick\Geo\Tests\Doctrine\Fixtures\LineStringEntity; | ||
use Doctrine\Common\DataFixtures\FixtureInterface; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
|
||
class LoadLineStringData implements FixtureInterface { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
function load(ObjectManager $manager) | ||
{ | ||
$point1 = Point::factory(0,0); | ||
$point2 = Point::factory(1,0); | ||
$point3 = Point::factory(1,1); | ||
|
||
$lineString1 = new LineStringEntity(); | ||
$lineString1->setLineString(LineString::factory([ $point1, $point2, $point3 ])); | ||
|
||
$manager->persist($lineString1); | ||
$manager->flush(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Brick\Geo\Tests\Doctrine\DataFixtures; | ||
|
||
use Brick\Geo\LineString; | ||
use Brick\Geo\MultiLineString; | ||
use Brick\Geo\Point; | ||
use Brick\Geo\Tests\Doctrine\Fixtures\MultiLineStringEntity; | ||
use Doctrine\Common\DataFixtures\FixtureInterface; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
|
||
class LoadMultiLineStringData implements FixtureInterface { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
function load(ObjectManager $manager) | ||
{ | ||
$point1 = Point::factory(0,0); | ||
$point2 = Point::factory(1,0); | ||
$point3 = Point::factory(1,1); | ||
$lineString1 = LineString::factory([ $point1, $point2, $point3 ]); | ||
|
||
$point4 = Point::factory(2,2); | ||
$point5 = Point::factory(3,2); | ||
$point6 = Point::factory(3,3); | ||
$lineString2 = LineString::factory([ $point4, $point5, $point6 ]); | ||
|
||
$multilineString1 = new MultiLineStringEntity(); | ||
$multilineString1->setMultiLineString(MultiLineString::factory([ $lineString1, $lineString2 ])); | ||
|
||
$manager->persist($multilineString1); | ||
$manager->flush(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Brick\Geo\Tests\Doctrine\DataFixtures; | ||
|
||
use Brick\Geo\MultiPoint; | ||
use Brick\Geo\Point; | ||
use Brick\Geo\Tests\Doctrine\Fixtures\MultiPointEntity; | ||
use Doctrine\Common\DataFixtures\FixtureInterface; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
|
||
class LoadMultiPointData implements FixtureInterface { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
function load(ObjectManager $manager) | ||
{ | ||
$point1 = Point::factory(0,0); | ||
$point2 = Point::factory(1,0); | ||
$point3 = Point::factory(1,1); | ||
|
||
$multiPoint1 = new MultiPointEntity(); | ||
$multiPoint1->setMultiPoint(MultiPoint::factory([ $point1, $point2, $point3 ])); | ||
|
||
$manager->persist($multiPoint1); | ||
$manager->flush(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Brick\Geo\Tests\Doctrine\DataFixtures; | ||
|
||
use Brick\Geo\LinearRing; | ||
use Brick\Geo\MultiPolygon; | ||
use Brick\Geo\Point; | ||
use Brick\Geo\Polygon; | ||
use Brick\Geo\Tests\Doctrine\Fixtures\MultiPolygonEntity; | ||
use Doctrine\Common\DataFixtures\FixtureInterface; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
|
||
class LoadMultiPolygonData implements FixtureInterface { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
function load(ObjectManager $manager) | ||
{ | ||
$point1 = Point::factory(0,0); | ||
$point2 = Point::factory(1,0); | ||
$point3 = Point::factory(1,1); | ||
$point4 = Point::factory(0,1); | ||
$point5 = Point::factory(0,0); | ||
$ring1 = LinearRing::factory([ $point1, $point2, $point3, $point4, $point5]); | ||
$poly1 = Polygon::factory([ $ring1 ]); | ||
|
||
$point6 = Point::factory(2,2); | ||
$point7 = Point::factory(3,2); | ||
$point8 = Point::factory(3,3); | ||
$point9 = Point::factory(2,3); | ||
$point10 = Point::factory(2,2); | ||
$ring2 = LinearRing::factory([ $point6, $point7, $point8, $point9, $point10]); | ||
$poly2 = Polygon::factory([ $ring2 ]); | ||
|
||
$multiPoly1 = new MultiPolygonEntity(); | ||
$multiPoly1->setMultiPolygon(MultiPolygon::factory([ $poly1, $poly2 ])); | ||
|
||
$manager->persist($multiPoly1); | ||
$manager->flush(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Brick\Geo\Tests\Doctrine\DataFixtures; | ||
|
||
use Brick\Geo\Point; | ||
use Brick\Geo\Tests\Doctrine\Fixtures\PointEntity; | ||
use Doctrine\Common\DataFixtures\FixtureInterface; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
|
||
class LoadPointData implements FixtureInterface { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
function load(ObjectManager $manager) | ||
{ | ||
$point1 = new PointEntity(); | ||
$point1->setPoint(Point::factory(0, 0)); | ||
|
||
$manager->persist($point1); | ||
$manager->flush(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Brick\Geo\Tests\Doctrine\DataFixtures; | ||
|
||
use Brick\Geo\LinearRing; | ||
use Brick\Geo\Point; | ||
use Brick\Geo\Polygon; | ||
use Brick\Geo\Tests\Doctrine\Fixtures\PolygonEntity; | ||
use Doctrine\Common\DataFixtures\FixtureInterface; | ||
use Doctrine\Common\Persistence\ObjectManager; | ||
|
||
class LoadPolygonData implements FixtureInterface { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
function load(ObjectManager $manager) | ||
{ | ||
$point1 = Point::factory(0,0); | ||
$point2 = Point::factory(1,0); | ||
$point3 = Point::factory(1,1); | ||
$point4 = Point::factory(0,1); | ||
$point5 = Point::factory(0,0); | ||
|
||
$ring = LinearRing::factory([ $point1, $point2, $point3, $point4, $point5]); | ||
|
||
$poly1 = new PolygonEntity(); | ||
$poly1->setPolygon(Polygon::factory([$ring])); | ||
|
||
$manager->persist($poly1); | ||
$manager->flush(); | ||
} | ||
} |
Oops, something went wrong.