本文整理汇总了PHP中PMA\libraries\Util::getGISDatatypes方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::getGISDatatypes方法的具体用法?PHP Util::getGISDatatypes怎么用?PHP Util::getGISDatatypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA\libraries\Util
的用法示例。
在下文中一共展示了Util::getGISDatatypes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: factory
/**
* 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;
}
}
示例2: _getGeomWhereClause
/**
* Return the where clause for a geometrical column.
*
* @param mixed $criteriaValues Search criteria input
* @param string $names Name of the column on which search is submitted
* @param string $func_type Search function/operator
* @param string $types Type of the field
* @param bool $geom_func Whether geometry functions should be applied
*
* @return string part of where clause.
*/
private function _getGeomWhereClause($criteriaValues, $names, $func_type, $types, $geom_func = null)
{
$geom_unary_functions = array('IsEmpty' => 1, 'IsSimple' => 1, 'IsRing' => 1, 'IsClosed' => 1);
$where = '';
// Get details about the geometry functions
$geom_funcs = Util::getGISFunctions($types, true, false);
// If the function takes multiple parameters
if ($geom_funcs[$geom_func]['params'] > 1) {
// create gis data from the criteria input
$gis_data = Util::createGISData($criteriaValues);
$where = $geom_func . '(' . Util::backquote($names) . ', ' . $gis_data . ')';
return $where;
}
// New output type is the output type of the function being applied
$type = $geom_funcs[$geom_func]['type'];
$geom_function_applied = $geom_func . '(' . Util::backquote($names) . ')';
// If the where clause is something like 'IsEmpty(`spatial_col_name`)'
if (isset($geom_unary_functions[$geom_func]) && trim($criteriaValues) == '') {
$where = $geom_function_applied;
} elseif (in_array($type, Util::getGISDatatypes()) && !empty($criteriaValues)) {
// create gis data from the criteria input
$gis_data = Util::createGISData($criteriaValues);
$where = $geom_function_applied . " " . $func_type . " " . $gis_data;
} elseif (mb_strlen($criteriaValues) > 0) {
$where = $geom_function_applied . " " . $func_type . " '" . $criteriaValues . "'";
}
return $where;
}