public function loadFromFile(&$ShapeFile, &$SHPFile, &$DBFFile)
    {
        $this->ShapeFile = $ShapeFile;
        $this->SHPFile = $SHPFile;
        $this->DBFFile = $DBFFile;
        $this->_loadHeaders();

        /* No header read */
        if ($this->read == 0) {
            return;
        }

        switch ($this->shapeType) {
            case 0:
                $this->_loadNullRecord();
                break;
            case 1:
                $this->_loadPointRecord();
                break;
            case 21:
                $this->_loadPointMRecord();
                break;
            case 11:
                $this->_loadPointZRecord();
                break;
            case 3:
                $this->_loadPolyLineRecord();
                break;
            case 23:
                $this->_loadPolyLineMRecord();
                break;
            case 13:
                $this->_loadPolyLineZRecord();
                break;
            case 5:
                $this->_loadPolygonRecord();
                break;
            case 25:
                $this->_loadPolygonMRecord();
                break;
            case 15:
                $this->_loadPolygonZRecord();
                break;
            case 8:
                $this->_loadMultiPointRecord();
                break;
            case 28:
                $this->_loadMultiPointMRecord();
                break;
            case 18:
                $this->_loadMultiPointZRecord();
                break;
            default:
                $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType));
                break;
        }

        /* We need to skip rest of the record */
        while ($this->read < $this->size) {
            $this->_loadData('V', 4);
        }

        /* Check if we didn't read too much */
        if ($this->read != $this->size) {
            $this->setError(sprintf('Failed to parse record, read=%d, size=%d', $this->read, $this->size));
        }

        if (ShapeFile::supportsDbase() && isset($this->DBFFile)) {
            $this->_loadDBFData();
        }
    }