PHP Class PMA\libraries\gis\GISVisualization

Show file Open project: phpmyadmin/phpmyadmin Class Usage Examples

Public Methods

Method Description
asOl ( ) : string Get the code for visualization with OpenLayers.
asPng ( ) : string Get the visualization as a PNG.
asSVG ( ) : string Get the visualization as a SVG.
get ( string $sql_query, array $options, integer $row, integer $pos ) : GISVisualization Factory
getByData ( array $data, array $options ) : GISVisualization Get visualization
getSettings ( ) : array Returns the settings array
hasSrid ( ) : boolean Check if data has SRID
setUserSpecifiedSettings ( array $userSpecifiedSettings ) : void Set user specified settings
toFile ( string $filename, string $format ) : void Convert file to given format
toFileAsPdf ( string $file_name ) : void Saves as a PDF to a file.
toFileAsPng ( string $file_name ) : void Saves as a PNG image to a file.
toFileAsSvg ( string $file_name ) : void Saves as a SVG image to a file.
toImage ( string $format ) : string Convert file to image

Protected Methods

Method Description
init ( ) : void All the variable initialization, options handling has to be done here.

Private Methods

Method Description
__construct ( string $sql_query, array $options, integer $row, integer $pos, array $data = null ) Constructor. Stores user specified options.
_fetchRawData ( ) : string Returns raw data for GIS visualization.
_handleOptions ( ) : void A function which handles passed parameters. Useful if desired chart needs to be a little bit different from the default one.
_modifySqlQuery ( string $sql_query, integer $rows, integer $pos ) : string Returns sql for fetching raw data
_png ( ) : resource Generate the visualization in PNG format.
_prepareDataSet ( array $data, array $scale_data, string $format, object $results ) : mixed Prepares and return the dataset as needed by the visualization.
_sanitizeName ( string $file_name, string $ext ) : string Sanitizes the file name.
_scaleDataSet ( array $data ) : array Calculates the scale, horizontal and vertical offset that should be used.
_svg ( ) : string Generate the visualization in SVG format.
_toFile ( string $file_name, string $type, string $ext ) : void Handles common tasks of writing the visualization to file for various formats.

Method Details

asOl() public method

Get the code for visualization with OpenLayers.
public asOl ( ) : string
return string the code for visualization with OpenLayers

asPng() public method

Get the visualization as a PNG.
public asPng ( ) : string
return string the visualization as a PNG

asSVG() public method

Get the visualization as a SVG.
public asSVG ( ) : string
return string the visualization as a SVG

get() public static method

Factory
public static get ( string $sql_query, array $options, integer $row, integer $pos ) : GISVisualization
$sql_query string SQL to fetch raw data for visualization
$options array Users specified options
$row integer number of rows
$pos integer start position
return GISVisualization

getByData() public static method

Get visualization
public static getByData ( array $data, array $options ) : GISVisualization
$data array Raw data, if set, parameters other than $options will be ignored
$options array Users specified options
return GISVisualization

getSettings() public method

Returns the settings array
public getSettings ( ) : array
return array the settings array

hasSrid() public method

Check if data has SRID
public hasSrid ( ) : boolean
return boolean

init() protected method

All the variable initialization, options handling has to be done here.
protected init ( ) : void
return void

setUserSpecifiedSettings() public method

Set user specified settings
public setUserSpecifiedSettings ( array $userSpecifiedSettings ) : void
$userSpecifiedSettings array User specified settings
return void

toFile() public method

Convert file to given format
public toFile ( string $filename, string $format ) : void
$filename string Filename
$format string Output format
return void

toFileAsPdf() public method

Saves as a PDF to a file.
public toFileAsPdf ( string $file_name ) : void
$file_name string File name
return void

toFileAsPng() public method

Saves as a PNG image to a file.
public toFileAsPng ( string $file_name ) : void
$file_name string File name
return void

toFileAsSvg() public method

Saves as a SVG image to a file.
public toFileAsSvg ( string $file_name ) : void
$file_name string File name
return void

toImage() public method

Convert file to image
public toImage ( string $format ) : string
$format string Output format
return string File