PHP Класс PMA\libraries\gis\GISPolygon

Наследование: extends PMA\libraries\gis\GISGeometry
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
__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.

Описание методов

area() публичный статический Метод

Calculates the area of a closed simple polygon.
public static area ( array $ring ) : float
$ring array array of points forming the ring
Результат float the area of a closed simple polygon

generateParams() публичный Метод

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
Результат array params for the GIS data editor from the value of the GIS column

generateWkt() публичный Метод

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
Результат string WKT with the set of parameters passed by the GIS editor

getPointOnSurface() публичный статический Метод

(for simple closed rings)
public static getPointOnSurface ( array $ring ) : array | void
$ring array array of points forming the ring
Результат array | void a point on the surface of the ring

isOuterRing() публичный статический Метод

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
Результат boolean whether a set of points represents an outer ring

isPointInsidePolygon() публичный статический Метод

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
Результат boolean whether a given point is inside a given polygon

prepareRowAsOl() публичный Метод

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
Результат string JavaScript related to a row in the GIS dataset

prepareRowAsPdf() публичный Метод

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
Результат TCPDF the modified TCPDF instance

prepareRowAsPng() публичный Метод

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
Результат object the modified image object

prepareRowAsSvg() публичный Метод

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
Результат string the code related to a row in the GIS dataset

scaleRow() публичный Метод

Scales each row.
public scaleRow ( string $spatial ) : array
$spatial string spatial data of a row
Результат array an array containing the min, max values for x and y coordinates

singleton() публичный статический Метод

Returns the singleton.
public static singleton ( ) : GISPolygon
Результат GISPolygon the singleton