Code Duplication    Length = 15-15 lines in 2 locations

LatLng.php 2 locations

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