PHP Class PMA\libraries\gis\GISPolygon

Inheritance: extends PMA\libraries\gis\GISGeometry
Afficher le fichier Open project: phpmyadmin/phpmyadmin Class Usage Examples

Méthodes publiques

Méthode Description
area ( array $ring ) : float Calculates the area of a closed simple polygon.
generateParams ( string $value, integer $index ) : array Generate parameters for the GIS data editor from the value of the GIS column.
generateWkt ( array $gis_data, integer $index, string $empty = '' ) : string Generate the WKT with the set of parameters passed by the GIS editor.
getPointOnSurface ( array $ring ) : array | void Returns a point that is guaranteed to be on the surface of the ring.
isOuterRing ( array $ring ) : boolean Determines whether a set of points represents an outer ring.
isPointInsidePolygon ( array $point, array $polygon ) : boolean Determines whether a given point is inside a given polygon.
prepareRowAsOl ( string $spatial, integer $srid, string $label, string $fill_color, array $scale_data ) : string Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
prepareRowAsPdf ( string $spatial, string $label, string $fill_color, array $scale_data, TCPDF $pdf ) : TCPDF Adds to the TCPDF instance, the data related to a row in the GIS dataset.
prepareRowAsPng ( string $spatial, string $label, string $fill_color, array $scale_data, object $image ) : object Adds to the PNG image object, the data related to a row in the GIS dataset.
prepareRowAsSvg ( string $spatial, string $label, string $fill_color, array $scale_data ) : string Prepares and returns the code related to a row in the GIS dataset as SVG.
scaleRow ( string $spatial ) : array Scales each row.
singleton ( ) : GISPolygon Returns the singleton.

Private Methods

Méthode Description
__construct ( ) A private constructor; prevents direct creation of object.
_drawPath ( string $polygon, array $scale_data ) : string Draws a ring of the polygon using SVG path element.

Method Details

area() public static méthode

Calculates the area of a closed simple polygon.
public static area ( array $ring ) : float
$ring array array of points forming the ring
Résultat float the area of a closed simple polygon

generateParams() public méthode

Generate parameters for the GIS data editor from the value of the GIS column.
public generateParams ( string $value, integer $index ) : array
$value string Value of the GIS column
$index integer Index of the geometry
Résultat array params for the GIS data editor from the value of the GIS column

generateWkt() public méthode

Generate the WKT with the set of parameters passed by the GIS editor.
public generateWkt ( array $gis_data, integer $index, string $empty = '' ) : string
$gis_data array GIS data
$index integer Index into the parameter object
$empty string Value for empty points
Résultat string WKT with the set of parameters passed by the GIS editor

getPointOnSurface() public static méthode

(for simple closed rings)
public static getPointOnSurface ( array $ring ) : array | void
$ring array array of points forming the ring
Résultat array | void a point on the surface of the ring

isOuterRing() public static méthode

If points are in clockwise orientation then, they form an outer ring.
public static isOuterRing ( array $ring ) : boolean
$ring array array of points forming the ring
Résultat boolean whether a set of points represents an outer ring

isPointInsidePolygon() public static méthode

Determines whether a given point is inside a given polygon.
public static isPointInsidePolygon ( array $point, array $polygon ) : boolean
$point array x, y coordinates of the point
$polygon array array of points forming the ring
Résultat boolean whether a given point is inside a given polygon

prepareRowAsOl() public méthode

Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
public prepareRowAsOl ( string $spatial, integer $srid, string $label, string $fill_color, array $scale_data ) : string
$spatial string GIS POLYGON object
$srid integer Spatial reference ID
$label string Label for the GIS POLYGON object
$fill_color string Color for the GIS POLYGON object
$scale_data array Array containing data related to scaling
Résultat string JavaScript related to a row in the GIS dataset

prepareRowAsPdf() public méthode

Adds to the TCPDF instance, the data related to a row in the GIS dataset.
public prepareRowAsPdf ( string $spatial, string $label, string $fill_color, array $scale_data, TCPDF $pdf ) : TCPDF
$spatial string GIS POLYGON object
$label string Label for the GIS POLYGON object
$fill_color string Color for the GIS POLYGON object
$scale_data array Array containing data related to scaling
$pdf TCPDF TCPDF instance
Résultat TCPDF the modified TCPDF instance

prepareRowAsPng() public méthode

Adds to the PNG image object, the data related to a row in the GIS dataset.
public prepareRowAsPng ( string $spatial, string $label, string $fill_color, array $scale_data, object $image ) : object
$spatial string GIS POLYGON object
$label string Label for the GIS POLYGON object
$fill_color string Color for the GIS POLYGON object
$scale_data array Array containing data related to scaling
$image object Image object
Résultat object the modified image object

prepareRowAsSvg() public méthode

Prepares and returns the code related to a row in the GIS dataset as SVG.
public prepareRowAsSvg ( string $spatial, string $label, string $fill_color, array $scale_data ) : string
$spatial string GIS POLYGON object
$label string Label for the GIS POLYGON object
$fill_color string Color for the GIS POLYGON object
$scale_data array Array containing data related to scaling
Résultat string the code related to a row in the GIS dataset

scaleRow() public méthode

Scales each row.
public scaleRow ( string $spatial ) : array
$spatial string spatial data of a row
Résultat array an array containing the min, max values for x and y coordinates

singleton() public static méthode

Returns the singleton.
public static singleton ( ) : GISPolygon
Résultat GISPolygon the singleton