3 * Factory class that handles the creation of geometric objects.
5 * @package phpMyAdmin-GIS
10 * Returns the singleton instance of geometric class of the given type.
12 * @param string $type type of the geometric object
16 * @return the singleton instance of geometric class of the given type
18 public static function factory($type)
20 include_once './libraries/gis/pma_gis_geometry.php';
22 $type_lower = strtolower($type);
23 if (! file_exists('./libraries/gis/pma_gis_' . $type_lower . '.php')) {
26 if (include_once './libraries/gis/pma_gis_' . $type_lower . '.php') {
29 return PMA_GIS_Multipolygon
::singleton();
31 return PMA_GIS_Polygon
::singleton();
33 return PMA_GIS_Multipoint
::singleton();
35 return PMA_GIS_Point
::singleton();
36 case 'MULTILINESTRING' :
37 return PMA_GIS_Multilinestring
::singleton();
39 return PMA_GIS_Linestring
::singleton();
40 case 'GEOMETRYCOLLECTION' :
41 return PMA_GIS_Geometrycollection
::singleton();