final class Gis (View source)

Methods

static string
convertToWellKnownText(string $data, bool $includeSRID = false)

Converts GIS data to Well Known Text format

static array
getDataTypes(bool $upperCase = false)

Return GIS data types

static string
createData(string $gisString, int $mysqlVersion)

Generates GIS data based on the string passed.

static array
getFunctions(string|null $geomType = null, bool $binary = true, bool $display = false)

Returns the names and details of the functions that can be applied on geometry data types.

Details

static string convertToWellKnownText(string $data, bool $includeSRID = false)

Converts GIS data to Well Known Text format

Parameters

string $data

GIS data

bool $includeSRID

Add SRID to the WKT

Return Value

string

GIS data in Well Know Text format

static array getDataTypes(bool $upperCase = false)

Return GIS data types

Parameters

bool $upperCase

whether to return values in upper case

Return Value

array

GIS data types

static string createData(string $gisString, int $mysqlVersion)

Generates GIS data based on the string passed.

Parameters

string $gisString

GIS string

int $mysqlVersion

The mysql version as int

Return Value

string

GIS data enclosed in 'ST_GeomFromText' or 'GeomFromText' function

static array getFunctions(string|null $geomType = null, bool $binary = true, bool $display = false)

Returns the names and details of the functions that can be applied on geometry data types.

Parameters

string|null $geomType

if provided the output is limited to the functions that are applicable to the provided geometry type.

bool $binary

if set to false functions that take two geometries as arguments will not be included.

bool $display

if set to true separators will be added to the output array.

Return Value

array

names and details of the functions that can be applied on geometry data types.