class GisPoint extends GisGeometry (View source)

Handles actions related to GIS POINT objects

Methods

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

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

prepareRowAsPng(string $spatial, string|null $label, string $point_color, array $scale_data, ImageWrapper $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 $point_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, array $point_color, array $scale_data)

Prepares 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|null $empty = '')

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

string
getBoundsForOl(int $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, int $index = -1)

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

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

Extracts points, scales and returns them as an array.

string
getPolygonArrayForOpenLayers(array $polygons, int $srid)

Generates JavaScript for adding an array of polygons to OpenLayers.

string
getPolygonForOpenLayers(array $polygon, int $srid)

Generates JavaScript for adding points for OpenLayers polygon.

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

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

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

Generates JavaScript for adding a LineString or LineRing to OpenLayers.

string
getPointsArrayForOpenLayers(array $points_arr, int $srid)

Generates JavaScript for adding an array of points to OpenLayers.

string
getPointForOpenLayers(array $point, int $srid)

Generates JavaScript for adding a point to OpenLayers.

int
getRandomId()

No description

static GisPoint
singleton()

Returns the singleton.

string
getShape(array $row_data)

Generate the WKT for the data from ESRI shape files.

Details

string prepareRowAsSvg(string $spatial, string $label, string $point_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 $point_color

Color for the GIS POINT object

array $scale_data

data related to scaling

Return Value

string

the code related to a row in the GIS dataset

ImageWrapper prepareRowAsPng(string $spatial, string|null $label, string $point_color, array $scale_data, ImageWrapper $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 $point_color

Color for the GIS POLYGON object

array $scale_data

Array containing data related to scaling

ImageWrapper $image

Return Value

ImageWrapper

TCPDF prepareRowAsPdf(string $spatial, string|null $label, string $point_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 $point_color

Color for the GIS POINT object

array $scale_data

array containing data related to scaling

TCPDF $pdf

TCPDF instance

Return Value

TCPDF

the modified TCPDF instance

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

Prepares 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

array $point_color

Color for the GIS POINT object

array $scale_data

array containing data related to scaling

Return Value

string

the JavaScript related to a row in the GIS dataset

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

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

Generate 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|null $empty

value for empty points

Return Value

string

WKT with the set of parameters passed by the GIS editor

protected string getBoundsForOl(int $srid, array $scale_data)

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

Parameters

int $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

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

array generateParams(string $value, int $index = -1)

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

Parameters

string $value

value of the GIS column

int $index

of the geometry

Return Value

array

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

protected array extractPoints(string $point_set, array|null $scale_data, bool $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

bool $linear

if true, as a 1D array, else as a 2D array

Return Value

array

scaled points

protected string getPolygonArrayForOpenLayers(array $polygons, int $srid)

Generates JavaScript for adding an array of polygons to OpenLayers.

Parameters

array $polygons

x and y coordinates for each polygon

int $srid

spatial reference id

Return Value

string

JavaScript for adding an array of polygons to OpenLayers

protected string getPolygonForOpenLayers(array $polygon, int $srid)

Generates JavaScript for adding points for OpenLayers polygon.

Parameters

array $polygon

x and y coordinates for each line

int $srid

spatial reference id

Return Value

string

JavaScript for adding points for OpenLayers polygon

protected string getLineArrayForOpenLayers(array $lines, int $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

int $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

protected string getLineForOpenLayers(array $points_arr, int $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

int $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

protected string getPointsArrayForOpenLayers(array $points_arr, int $srid)

Generates JavaScript for adding an array of points to OpenLayers.

Parameters

array $points_arr

x and y coordinates for each point

int $srid

spatial reference id

Return Value

string

JavaScript for adding an array of points to OpenLayers

protected string getPointForOpenLayers(array $point, int $srid)

Generates JavaScript for adding a point to OpenLayers.

Parameters

array $point

array containing the x and y coordinates of the point

int $srid

spatial reference id

Return Value

string

JavaScript for adding points to OpenLayers

protected int getRandomId()

No description

Return Value

int

static GisPoint singleton()

Returns the singleton.

Return Value

GisPoint

the singleton

string getShape(array $row_data)

Generate the WKT for the data from ESRI shape files.

Parameters

array $row_data

GIS data

Return Value

string

the WKT for the data from ESRI shape files