|
@@ 368-382 (lines=15) @@
|
| 365 |
|
* |
| 366 |
|
* @return OSRef |
| 367 |
|
*/ |
| 368 |
|
public function toOSRef() |
| 369 |
|
{ |
| 370 |
|
$this->toOSGB36(); |
| 371 |
|
|
| 372 |
|
$OSGB = new OSRef(0, 0); //dummy to get reference data |
| 373 |
|
$scale = $OSGB->getScaleFactor(); |
| 374 |
|
$N0 = $OSGB->getOriginNorthing(); |
| 375 |
|
$E0 = $OSGB->getOriginEasting(); |
| 376 |
|
$phi0 = $OSGB->getOriginLatitude(); |
| 377 |
|
$lambda0 = $OSGB->getOriginLongitude(); |
| 378 |
|
|
| 379 |
|
$coords = $this->toTransverseMercatorEastingNorthing($scale, $E0, $N0, $phi0, $lambda0); |
| 380 |
|
|
| 381 |
|
return new OSRef(round($coords['E']), round($coords['N']), $this->h); |
| 382 |
|
} |
| 383 |
|
|
| 384 |
|
/** |
| 385 |
|
* Convert this LatLng object into an ITM grid reference |
|
@@ 389-403 (lines=15) @@
|
| 386 |
|
* |
| 387 |
|
* @return ITMRef |
| 388 |
|
*/ |
| 389 |
|
public function toITMRef() |
| 390 |
|
{ |
| 391 |
|
$this->toWGS84(); |
| 392 |
|
|
| 393 |
|
$ITM = new ITMRef(0, 0); //dummy to get reference data |
| 394 |
|
$scale = $ITM->getScaleFactor(); |
| 395 |
|
$N0 = $ITM->getOriginNorthing(); |
| 396 |
|
$E0 = $ITM->getOriginEasting(); |
| 397 |
|
$phi0 = $ITM->getOriginLatitude(); |
| 398 |
|
$lambda0 = $ITM->getOriginLongitude(); |
| 399 |
|
|
| 400 |
|
$coords = $this->toTransverseMercatorEastingNorthing($scale, $E0, $N0, $phi0, $lambda0); |
| 401 |
|
|
| 402 |
|
return new ITMRef(round($coords['E']), round($coords['N']), $this->h); |
| 403 |
|
} |
| 404 |
|
|
| 405 |
|
|
| 406 |
|
/** |