abstract class GisGeometry

Base class for all GIS data type classes.

Methods

string
prepareRowAsSvg(string $spatial, string $label, string $color, array $scale_data)

Prepares and returns the code related to a row in the GIS dataset as SVG.

resource
prepareRowAsPng(string $spatial, string|null $label, string $color, array $scale_data, resource $image)

Adds to the PNG image object, the data related to a row in the GIS dataset.

TCPDF
prepareRowAsPdf(string $spatial, string|null $label, string $color, array $scale_data, TCPDF $pdf)

Adds to the TCPDF instance, the data related to a row in the GIS dataset.

string
prepareRowAsOl(string $spatial, int $srid, string $label, string $color, array $scale_data)

Prepares the JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.

array
scaleRow(string $spatial)

Scales each row.

string
generateWkt(array $gis_data, int $index, string $empty = '')

Generates the WKT with the set of parameters passed by the GIS editor.

string
getBoundsForOl(string $srid, array $scale_data)

Returns OpenLayers.Bounds object that correspond to the bounds of GIS data.

array
setMinMax(string $point_set, array $min_max)

Updates the min, max values with the given point set.

array
generateParams(string $value)

Generates parameters for the GIS data editor from the value of the GIS column.

array
extractPoints(string $point_set, array|null $scale_data, boolean $linear = false)

Extracts points, scales and returns them as an array.

string
getPolygonArrayForOpenLayers(array $polygons, string $srid)

Generates JavaScript for adding an array of polygons to OpenLayers.

string
getPolygonForOpenLayers(array $polygon, string $srid)

Generates JavaScript for adding points for OpenLayers polygon.

string
getLineArrayForOpenLayers(array $lines, string $srid, bool $is_line_string = true)

Generates JavaScript for adding an array of LineString or LineRing to OpenLayers.

string
getLineForOpenLayers(array $points_arr, string $srid, bool $is_line_string = true)

Generates JavaScript for adding a LineString or LineRing to OpenLayers.

string
getPointsArrayForOpenLayers(array $points_arr, string $srid)

Generates JavaScript for adding an array of points to OpenLayers.

string
getPointForOpenLayers(array $point, string $srid)

Generates JavaScript for adding a point to OpenLayers.

Details

at line 31
abstract string prepareRowAsSvg(string $spatial, string $label, string $color, array $scale_data)

Prepares and returns the code related to a row in the GIS dataset as SVG.

Parameters

string $spatial GIS data object
string $label label for the GIS data object
string $color color for the GIS data object
array $scale_data data related to scaling

Return Value

string the code related to a row in the GIS dataset

at line 45
abstract resource prepareRowAsPng(string $spatial, string|null $label, string $color, array $scale_data, resource $image)

Adds to the PNG image object, the data related to a row in the GIS dataset.

Parameters

string $spatial GIS POLYGON object
string|null $label Label for the GIS POLYGON object
string $color Color for the GIS POLYGON object
array $scale_data Array containing data related to scaling
resource $image Image object

Return Value

resource the modified image object

at line 65
abstract TCPDF prepareRowAsPdf(string $spatial, string|null $label, string $color, array $scale_data, TCPDF $pdf)

Adds to the TCPDF instance, the data related to a row in the GIS dataset.

Parameters

string $spatial GIS data object
string|null $label label for the GIS data object
string $color color for the GIS data object
array $scale_data array containing data related to scaling
TCPDF $pdf TCPDF instance

Return Value

TCPDF the modified TCPDF instance

at line 86
abstract string prepareRowAsOl(string $spatial, int $srid, string $label, string $color, array $scale_data)

Prepares the JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.

Parameters

string $spatial GIS data object
int $srid spatial reference ID
string $label label for the GIS data object
string $color color for the GIS data object
array $scale_data array containing data related to scaling

Return Value

string the JavaScript related to a row in the GIS dataset

at line 102
abstract array scaleRow(string $spatial)

Scales each row.

Parameters

string $spatial spatial data of a row

Return Value

array array containing the min, max values for x and y coordinates

at line 114
abstract string generateWkt(array $gis_data, int $index, string $empty = '')

Generates the WKT with the set of parameters passed by the GIS editor.

Parameters

array $gis_data GIS data
int $index index into the parameter object
string $empty value for empty points

Return Value

string WKT with the set of parameters passed by the GIS editor

at line 126
protected string getBoundsForOl(string $srid, array $scale_data)

Returns OpenLayers.Bounds object that correspond to the bounds of GIS data.

Parameters

string $srid spatial reference ID
array $scale_data data related to scaling

Return Value

string OpenLayers.Bounds object that correspond to the bounds of GIS data

at line 148
protected array setMinMax(string $point_set, array $min_max)

Updates the min, max values with the given point set.

Parameters

string $point_set point set
array $min_max existing min, max values

Return Value

array the updated min, max values

at line 186
protected array generateParams(string $value)

Generates parameters for the GIS data editor from the value of the GIS column.

This method performs common work. More specific work is performed by each of the geom classes.

Parameters

string $value value of the GIS column

Return Value

array parameters for the GIS editor from the value of the GIS column

at line 217
protected array extractPoints(string $point_set, array|null $scale_data, boolean $linear = false)

Extracts points, scales and returns them as an array.

Parameters

string $point_set string of comma separated points
array|null $scale_data data related to scaling
boolean $linear if true, as a 1D array, else as a 2D array

Return Value

array scaled points

at line 266
protected string getPolygonArrayForOpenLayers(array $polygons, string $srid)

Generates JavaScript for adding an array of polygons to OpenLayers.

Parameters

array $polygons x and y coordinates for each polygon
string $srid spatial reference id

Return Value

string JavaScript for adding an array of polygons to OpenLayers

at line 294
protected string getPolygonForOpenLayers(array $polygon, string $srid)

Generates JavaScript for adding points for OpenLayers polygon.

Parameters

array $polygon x and y coordinates for each line
string $srid spatial reference id

Return Value

string JavaScript for adding points for OpenLayers polygon

at line 313
protected string getLineArrayForOpenLayers(array $lines, string $srid, bool $is_line_string = true)

Generates JavaScript for adding an array of LineString or LineRing to OpenLayers.

Parameters

array $lines x and y coordinates for each line
string $srid spatial reference id
bool $is_line_string whether it's an array of LineString

Return Value

string JavaScript for adding an array of LineString or LineRing to OpenLayers

at line 350
protected string getLineForOpenLayers(array $points_arr, string $srid, bool $is_line_string = true)

Generates JavaScript for adding a LineString or LineRing to OpenLayers.

Parameters

array $points_arr x and y coordinates for each point
string $srid spatial reference id
bool $is_line_string whether it's a LineString

Return Value

string JavaScript for adding a LineString or LineRing to OpenLayers

at line 370
protected string getPointsArrayForOpenLayers(array $points_arr, string $srid)

Generates JavaScript for adding an array of points to OpenLayers.

Parameters

array $points_arr x and y coordinates for each point
string $srid spatial reference id

Return Value

string JavaScript for adding an array of points to OpenLayers

at line 397
protected string getPointForOpenLayers(array $point, string $srid)

Generates JavaScript for adding a point to OpenLayers.

Parameters

array $point array containing the x and y coordinates of the point
string $srid spatial reference id

Return Value

string JavaScript for adding points to OpenLayers