PHP Class Tdt\Core\Formatters\GEOJSONFormatter

Author: Jan Vansteenlandt ([email protected])
Inheritance: implements Tdt\Core\Formatters\IFormatter
ファイルを表示 Open project: tdt/core

Public Methods

Method Description
boundingBox ( $features ) : array Returns an array of n*2 numbers, where n is the maximum dimension of each coordinate present in the dataset. The first n numbers are the lower bounds of each dimension, the latter n numbers are the upper bounds of each dimension.
convertCoordinateArray ( $str ) : array
convertCoordinateMultiArray ( $str ) : array
convertCoordinateSingleArray ( $str ) : array
createResponse ( $dataObj )
findGeometry ( array $geo, array $dataRow ) : array
getBody ( $dataObj )
getDocumentation ( )
toCoordinateList ( $coordinates_array, &$out ) Converts a coordinate array of a feature of any type to an array containing all used coordinates. Each coordinate is represented by an array of numbers, with one number for each dimension.

Method Details

boundingBox() public static method

Returns an array of n*2 numbers, where n is the maximum dimension of each coordinate present in the dataset. The first n numbers are the lower bounds of each dimension, the latter n numbers are the upper bounds of each dimension.
public static boundingBox ( $features ) : array
$features array features for which to calculate the bounds
return array

convertCoordinateArray() public static method

public static convertCoordinateArray ( $str ) : array
$str string eg: "1.1,2.2 3.3,4.4"
return array eg: ((1.1, 2.2), (3.3, 4.4))

convertCoordinateMultiArray() public static method

public static convertCoordinateMultiArray ( $str ) : array
$str string eg: "1.1,2.2 3.3,4.4; 5.5,6.6 7.7,8.8"
return array eg: (((1.1, 2.2), (3.3, 4.4)), ((5.5, 6.6), (7.7, 8.8))

convertCoordinateSingleArray() public static method

public static convertCoordinateSingleArray ( $str ) : array
$str string eg: "1.1,2.2; 3.3,4.4; 5.5,6.6"
return array eg: ((1.1, 2.2), (3.3, 4.4), (5.5, 6.6), (7.7, 8.8))

createResponse() public static method

public static createResponse ( $dataObj )

findGeometry() public static method

public static findGeometry ( array $geo, array $dataRow ) : array
$geo array an array holding the identifier(s) for the geographical attribute
$dataRow array an array holding data
return array an array containing the identifier(s) of the selected attribute and an object representing the extracted geometry

getBody() public static method

public static getBody ( $dataObj )

getDocumentation() public static method

public static getDocumentation ( )

toCoordinateList() public static method

Converts a coordinate array of a feature of any type to an array containing all used coordinates. Each coordinate is represented by an array of numbers, with one number for each dimension.
public static toCoordinateList ( $coordinates_array, &$out )
$coordinates_array
$out array eg for 2D data: ((1, 1), (2, 2), (3, 3))