Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from tvogt/master
additional ST_* functions for PostGIS
- Loading branch information
Showing
11 changed files
with
479 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
lib/CrEOF/Spatial/ORM/Query/AST/Functions/PostgreSql/STDifference.php
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,44 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2012 Derek J. Lambert | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
namespace CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql; | ||
|
||
use CrEOF\Spatial\ORM\Query\AST\Functions\AbstractSpatialDQLFunction; | ||
use CrEOF\Spatial\ORM\Query\AST\Functions\ReturnsGeometryInterface; | ||
|
||
/** | ||
* ST_Difference DQL function | ||
* | ||
* @author Tom Vogt <tom@lemuria.org> | ||
* @license http:// mit-license.org MIT | ||
*/ | ||
class STDifference extends AbstractSpatialDQLFunction implements ReturnsGeometryInterface | ||
{ | ||
protected $platforms = array('postgresql'); | ||
|
||
protected $functionName = 'ST_Difference'; | ||
|
||
protected $minGeomExpr = 2; | ||
|
||
protected $maxGeomExpr = 2; | ||
} |
43 changes: 43 additions & 0 deletions
43
lib/CrEOF/Spatial/ORM/Query/AST/Functions/PostgreSql/STEndPoint.php
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,43 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2012 Derek J. Lambert | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
namespace CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql; | ||
|
||
use CrEOF\Spatial\ORM\Query\AST\Functions\AbstractSpatialDQLFunction; | ||
|
||
/** | ||
* ST_EndPoint DQL function | ||
* | ||
* @author Derek J. Lambert <dlambert@dereklambert.com> | ||
* @license http://dlambert.mit-license.org MIT | ||
*/ | ||
class STEndPoint extends AbstractSpatialDQLFunction | ||
{ | ||
protected $platforms = array('postgresql'); | ||
|
||
protected $functionName = 'ST_EndPoint'; | ||
|
||
protected $minGeomExpr = 1; | ||
|
||
protected $maxGeomExpr = 1; | ||
} |
44 changes: 44 additions & 0 deletions
44
lib/CrEOF/Spatial/ORM/Query/AST/Functions/PostgreSql/STGeometryN.php
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,44 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2012 Derek J. Lambert | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
namespace CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql; | ||
|
||
use CrEOF\Spatial\ORM\Query\AST\Functions\AbstractSpatialDQLFunction; | ||
use CrEOF\Spatial\ORM\Query\AST\Functions\ReturnsGeometryInterface; | ||
|
||
/** | ||
* ST_GeometryN DQL function | ||
* | ||
* @author Tom Vogt <tom@lemuria.org> | ||
* @license http:// mit-license.org MIT | ||
*/ | ||
class STGeometryN extends AbstractSpatialDQLFunction implements ReturnsGeometryInterface | ||
{ | ||
protected $platforms = array('postgresql'); | ||
|
||
protected $functionName = 'ST_GeometryN'; | ||
|
||
protected $minGeomExpr = 2; | ||
|
||
protected $maxGeomExpr = 2; | ||
} |
43 changes: 43 additions & 0 deletions
43
lib/CrEOF/Spatial/ORM/Query/AST/Functions/PostgreSql/STLineLocatePoint.php
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,43 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2012 Tom Vogt | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
namespace CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql; | ||
|
||
use CrEOF\Spatial\ORM\Query\AST\Functions\AbstractSpatialDQLFunction; | ||
|
||
/** | ||
* ST_Line_Locate_Point DQL function | ||
* | ||
* @author Tom Vogt <tom@lemuria.org> | ||
* @license http://mit-license.org MIT | ||
*/ | ||
class STLineLocatePoint extends AbstractSpatialDQLFunction | ||
{ | ||
protected $platforms = array('postgresql'); | ||
|
||
protected $functionName = 'ST_Line_Locate_Point'; | ||
|
||
protected $minGeomExpr = 2; | ||
|
||
protected $maxGeomExpr = 2; | ||
} |
44 changes: 44 additions & 0 deletions
44
lib/CrEOF/Spatial/ORM/Query/AST/Functions/PostgreSql/STLineSubstring.php
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,44 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2012 Derek J. Lambert | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
namespace CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql; | ||
|
||
use CrEOF\Spatial\ORM\Query\AST\Functions\AbstractSpatialDQLFunction; | ||
use CrEOF\Spatial\ORM\Query\AST\Functions\ReturnsGeometryInterface; | ||
|
||
/** | ||
* ST_Line_Substring DQL function | ||
* | ||
* @author Tom Vogt <tom@lemuria.org> | ||
* @license http://mit-license.org MIT | ||
*/ | ||
class STLineSubstring extends AbstractSpatialDQLFunction implements ReturnsGeometryInterface | ||
{ | ||
protected $platforms = array('postgresql'); | ||
|
||
protected $functionName = 'ST_Line_Substring'; | ||
|
||
protected $minGeomExpr = 3; | ||
|
||
protected $maxGeomExpr = 3; | ||
} |
44 changes: 44 additions & 0 deletions
44
lib/CrEOF/Spatial/ORM/Query/AST/Functions/PostgreSql/STSplit.php
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,44 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2012 Derek J. Lambert | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
namespace CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql; | ||
|
||
use CrEOF\Spatial\ORM\Query\AST\Functions\AbstractSpatialDQLFunction; | ||
use CrEOF\Spatial\ORM\Query\AST\Functions\ReturnsGeometryInterface; | ||
|
||
/** | ||
* ST_Split DQL function | ||
* | ||
* @author Tom Vogt <tom@lemuria.org> | ||
* @license http:// mit-license.org MIT | ||
*/ | ||
class STSplit extends AbstractSpatialDQLFunction implements ReturnsGeometryInterface | ||
{ | ||
protected $platforms = array('postgresql'); | ||
|
||
protected $functionName = 'ST_Split'; | ||
|
||
protected $minGeomExpr = 2; | ||
|
||
protected $maxGeomExpr = 2; | ||
} |
44 changes: 44 additions & 0 deletions
44
lib/CrEOF/Spatial/ORM/Query/AST/Functions/PostgreSql/STTranslate.php
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,44 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2012 Derek J. Lambert | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
namespace CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql; | ||
|
||
use CrEOF\Spatial\ORM\Query\AST\Functions\AbstractSpatialDQLFunction; | ||
use CrEOF\Spatial\ORM\Query\AST\Functions\ReturnsGeometryInterface; | ||
|
||
/** | ||
* ST_Translate DQL function | ||
* | ||
* @author Tom Vogt <tom@lemuria.org> | ||
* @license http:// mit-license.org MIT | ||
*/ | ||
class STTranslate extends AbstractSpatialDQLFunction implements ReturnsGeometryInterface | ||
{ | ||
protected $platforms = array('postgresql'); | ||
|
||
protected $functionName = 'ST_Translate'; | ||
|
||
protected $minGeomExpr = 3; | ||
|
||
protected $maxGeomExpr = 4; | ||
} |
44 changes: 44 additions & 0 deletions
44
lib/CrEOF/Spatial/ORM/Query/AST/Functions/PostgreSql/STUnion.php
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,44 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2012 Derek J. Lambert | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
namespace CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql; | ||
|
||
use CrEOF\Spatial\ORM\Query\AST\Functions\AbstractSpatialDQLFunction; | ||
use CrEOF\Spatial\ORM\Query\AST\Functions\ReturnsGeometryInterface; | ||
|
||
/** | ||
* ST_Union DQL function | ||
* | ||
* @author Tom Vogt <tom@lemuria.org> | ||
* @license http://mit-license.org MIT | ||
*/ | ||
class STUnion extends AbstractSpatialDQLFunction implements ReturnsGeometryInterface | ||
{ | ||
protected $platforms = array('postgresql'); | ||
|
||
protected $functionName = 'ST_Union'; | ||
|
||
protected $minGeomExpr = 1; | ||
|
||
protected $maxGeomExpr = 2; | ||
} |
Oops, something went wrong.