@@ -65,7 +65,12 @@ class CompoundPoint extends Point implements ConvertiblePoint
6565 */
6666 protected ?DateTimeImmutable $ epoch ;
6767
68- protected function __construct (Compound $ crs , GeographicPoint |ProjectedPoint $ horizontalPoint , VerticalPoint $ verticalPoint , ?DateTimeInterface $ epoch = null )
68+ /**
69+ * Accuracy.
70+ */
71+ protected ?Length $ accuracy ;
72+
73+ protected function __construct (Compound $ crs , GeographicPoint |ProjectedPoint $ horizontalPoint , VerticalPoint $ verticalPoint , ?DateTimeInterface $ epoch = null , ?Length $ accuracy = null )
6974 {
7075 $ this ->horizontalPoint = $ horizontalPoint ;
7176 $ this ->verticalPoint = $ verticalPoint ;
@@ -75,11 +80,12 @@ protected function __construct(Compound $crs, GeographicPoint|ProjectedPoint $ho
7580 $ epoch = DateTimeImmutable::createFromMutable ($ epoch );
7681 }
7782 $ this ->epoch = $ epoch ;
83+ $ this ->accuracy = $ accuracy ;
7884 }
7985
80- public static function create (Compound $ crs , GeographicPoint |ProjectedPoint $ horizontalPoint , VerticalPoint $ verticalPoint , ?DateTimeInterface $ epoch = null ): self
86+ public static function create (Compound $ crs , GeographicPoint |ProjectedPoint $ horizontalPoint , VerticalPoint $ verticalPoint , ?DateTimeInterface $ epoch = null , ? Length $ accuracy = null ): self
8187 {
82- return new self ($ crs , $ horizontalPoint , $ verticalPoint , $ epoch );
88+ return new self ($ crs , $ horizontalPoint , $ verticalPoint , $ epoch, $ accuracy );
8389 }
8490
8591 public function getHorizontalPoint (): GeographicPoint |ProjectedPoint
@@ -102,6 +108,11 @@ public function getCoordinateEpoch(): ?DateTimeImmutable
102108 return $ this ->epoch ;
103109 }
104110
111+ public function getAccuracy (): ?Length
112+ {
113+ return $ this ->accuracy ;
114+ }
115+
105116 /**
106117 * Calculate distance between two points.
107118 */
@@ -144,7 +155,7 @@ public function convert(Compound|Geocentric|Geographic2D|Geographic3D|Projected|
144155 foreach ($ path as $ step ) {
145156 $ target = CoordinateReferenceSystem::fromSRID ($ step ['in_reverse ' ] ? $ step ['source_crs ' ] : $ step ['target_crs ' ]);
146157 /** @var VerticalPoint $newVerticalPoint */
147- $ newVerticalPoint = $ newVerticalPoint ->performOperation ($ step ['operation ' ], $ target , $ step ['in_reverse ' ], ['horizontalPoint ' => $ newHorizontalPoint ]);
158+ $ newVerticalPoint = $ newVerticalPoint ->performOperation ($ step ['operation ' ], $ target , $ step ['in_reverse ' ], new Metre ( $ step [ ' accuracy ' ]), ['horizontalPoint ' => $ newHorizontalPoint ]);
148159 }
149160
150161 return static ::create ($ to , $ newHorizontalPoint , $ newVerticalPoint , $ this ->epoch );
0 commit comments