PMA\libraries\Util::getGISDatatypes PHP Method

getGISDatatypes() public static method

Return GIS data types
public static getGISDatatypes ( boolean $upper_case = false ) : string[]
$upper_case boolean whether to return values in upper case
return string[] GIS data types
    public static function getGISDatatypes($upper_case = false)
    {
        $gis_data_types = array('geometry', 'point', 'linestring', 'polygon', 'multipoint', 'multilinestring', 'multipolygon', 'geometrycollection');
        if ($upper_case) {
            for ($i = 0, $nb = count($gis_data_types); $i < $nb; $i++) {
                $gis_data_types[$i] = mb_strtoupper($gis_data_types[$i]);
            }
        }
        return $gis_data_types;
    }

Usage Example

コード例 #1
0
ファイル: GISFactory.php プロジェクト: ryanfmurphy/phpmyadmin
 /**
  * Returns the singleton instance of geometric class of the given type.
  *
  * @param string $type type of the geometric object
  *
  * @return GISGeometry the singleton instance of geometric class
  *                          of the given type
  *
  * @access public
  * @static
  */
 public static function factory($type)
 {
     $type_lower = strtolower($type);
     $file = './libraries/gis/GIS' . ucfirst($type_lower) . '.php';
     if (!PMA_isValid($type_lower, PMA\libraries\Util::getGISDatatypes()) || !file_exists($file)) {
         return false;
     }
     if (include_once $file) {
         switch (strtoupper($type)) {
             case 'MULTIPOLYGON':
                 return GISMultipolygon::singleton();
             case 'POLYGON':
                 return GISPolygon::singleton();
             case 'MULTIPOINT':
                 return GISMultipoint::singleton();
             case 'POINT':
                 return GISPoint::singleton();
             case 'MULTILINESTRING':
                 return GISMultilinestring::singleton();
             case 'LINESTRING':
                 return GISLinestring::singleton();
             case 'GEOMETRYCOLLECTION':
                 return GISGeometrycollection::singleton();
             default:
                 return false;
         }
     } else {
         return false;
     }
 }
All Usage Examples Of PMA\libraries\Util::getGISDatatypes
Util