|
27 | 27 | use Bolt\structures\Time as BoltTime;
|
28 | 28 | use Bolt\structures\UnboundRelationship as BoltUnboundRelationship;
|
29 | 29 | use function call_user_func;
|
| 30 | +use Laudis\Neo4j\Types\Abstract3DPoint; |
| 31 | +use Laudis\Neo4j\Types\AbstractPoint; |
30 | 32 | use Laudis\Neo4j\Types\Cartesian3DPoint;
|
31 | 33 | use Laudis\Neo4j\Types\CartesianPoint;
|
32 | 34 | use Laudis\Neo4j\Types\CypherList;
|
|
42 | 44 | use Laudis\Neo4j\Types\Relationship;
|
43 | 45 | use Laudis\Neo4j\Types\Time;
|
44 | 46 | use Laudis\Neo4j\Types\UnboundRelationship;
|
| 47 | +use Laudis\Neo4j\Types\WGS843DPoint; |
| 48 | +use Laudis\Neo4j\Types\WGS84Point; |
45 | 49 | use UnexpectedValueException;
|
46 | 50 |
|
47 | 51 | /**
|
@@ -185,14 +189,24 @@ private function makeFromBoltUnboundRelationship(BoltUnboundRelationship $rel):
|
185 | 189 | );
|
186 | 190 | }
|
187 | 191 |
|
188 |
| - private function makeFromBoltPoint2D(BoltPoint2d $x): CartesianPoint |
| 192 | + private function makeFromBoltPoint2D(BoltPoint2d $x): AbstractPoint |
189 | 193 | {
|
190 |
| - return new CartesianPoint($x->x(), $x->y(), 'cartesian', $x->srid()); |
| 194 | + if ($x->srid() === CartesianPoint::SRID) { |
| 195 | + return new CartesianPoint($x->x(), $x->y()); |
| 196 | + } elseif ($x->srid() === WGS84Point::SRID) { |
| 197 | + return new WGS84Point($x->x(), $x->y()); |
| 198 | + } |
| 199 | + throw new UnexpectedValueException('An srid of '.$x->srid().' has been returned, which has not been implemented.'); |
191 | 200 | }
|
192 | 201 |
|
193 |
| - private function makeFromBoltPoint3D(BoltPoint3D $x): Cartesian3DPoint |
| 202 | + private function makeFromBoltPoint3D(BoltPoint3D $x): Abstract3DPoint |
194 | 203 | {
|
195 |
| - return new Cartesian3DPoint($x->x(), $x->y(), $x->z(), 'cartesian', $x->srid()); |
| 204 | + if ($x->srid() === Cartesian3DPoint::SRID) { |
| 205 | + return new Cartesian3DPoint($x->x(), $x->y(), $x->z()); |
| 206 | + } elseif ($x->srid() === WGS843DPoint::SRID) { |
| 207 | + return new WGS843DPoint($x->x(), $x->y(), $x->z()); |
| 208 | + } |
| 209 | + throw new UnexpectedValueException('An srid of '.$x->srid().' has been returned, which has not been implemented.'); |
196 | 210 | }
|
197 | 211 |
|
198 | 212 | private function makeFromBoltPath(BoltPath $path): Path
|
|
0 commit comments