private function coordsQueryString(array $coords) {
        $count = count($coords);
        //If is a simple lat long array
        if ($count == 2) {
            if (is_numeric($coords[0]) && is_numeric($coords[1])) {
                /**
                 * Orion uses Lat/Lng value instead Lng/Lat as GeoJson format,
                 *  since a geoJson is passed it should be reversed to fit on Orion Format.
                 * All function of array_reverse uses
                 */
                return implode(',', array_reverse($coords));
//                return implode(',', $coords);
            } elseif (is_array($coords[0]) && is_array($coords[1])) { //Maybe is a 2 points line
                foreach ($coords[0] as $key => $coord) {
                    $coords[0][$key] = implode(',', array_reverse($coord));
//                    $coords[0][$key] = implode(',', $coord);
                }
                return implode(";", $coords[0]);
            }
        }
        //If is a polygon  geometry, multiple polygons aren't supported
        if ($count == 1 && is_array($coords[0]) && count($coords[0]) >= 3) {
            foreach ($coords[0] as $key => $coord) {
                $coords[0][$key] = implode(',', array_reverse($coord));
//                $coords[0][$key] = implode(',', $coord);
            }
            return implode(";", $coords[0]);
        }

        //Maybe is a 3 points + line:
        if ($count > 2) {
            $first = $coords[0];
            $last = end($coords);
            reset($coords);

            //but just maybe, be kind with me or sugest a new function to do that.
            if (is_array($first) && is_array($last)) {
                foreach ($coords as $key => $coord) {
                    $coords[$key] = implode(',', $coord);
                }
                return implode(";", $coords);
            }
        }

        throw new \LogicException("You got me! :( Please report it to https://github.com/VM9/orion-explorer-php-frame-work/issues ");
    }
private function coordsQueryString(array $coords) {
        $count = count($coords);
        //If is a simple lat long array
        if ($count == 2) {
            if (is_numeric($coords[0]) && is_numeric($coords[1])) {
                /**
                 * Orion uses Lat/Lng value instead Lng/Lat as GeoJson format,
                 *  since a geoJson is passed it should be reversed to fit on Orion Format.
                 * All function of array_reverse uses
                 */
                return implode(',', array_reverse($coords));
//                return implode(',', $coords);
            } elseif (is_array($coords[0]) && is_array($coords[1])) { //Maybe is a 2 points line
                foreach ($coords[0] as $key => $coord) {
                    $coords[0][$key] = implode(',', array_reverse($coord));
//                    $coords[0][$key] = implode(',', $coord);
                }
                return implode(";", $coords[0]);
            }
        }
        //If is a polygon  geometry, multiple polygons aren't supported
        if ($count == 1 && is_array($coords[0]) && count($coords[0]) >= 3) {
            foreach ($coords[0] as $key => $coord) {
                $coords[0][$key] = implode(',', array_reverse($coord));
//                $coords[0][$key] = implode(',', $coord);
            }
            return implode(";", $coords[0]);
        }

        //Maybe is a 3 points + line:
        if ($count > 2) {
            $first = $coords[0];
            $last = end($coords);
            reset($coords);

            //but just maybe, be kind with me or sugest a new function to do that.
            if (is_array($first) && is_array($last)) {
                foreach ($coords as $key => $coord) {
                    $coords[$key] = implode(',', $coord);
                }
                return implode(";", $coords);
            }
        }

        throw new \LogicException("You got me! :( Please report it to https://github.com/VM9/orion-explorer-php-frame-work/issues ");
    }
private function coordsQueryString ( array $ coords ) { $ count = count ( $ coords ) ; //If is a simple lat long array if ( $ count == 2 ) { if ( is_numeric ( $ coords [ 0 ] ) && is_numeric ( $ coords [ 1 ] ) ) { /**
                 * Orion uses Lat/Lng value instead Lng/Lat as GeoJson format,
                 *  since a geoJson is passed it should be reversed to fit on Orion Format.
                 * All function of array_reverse uses
                 */ return implode ( ',' , array_reverse ( $ coords ) ) ; //                return implode(',', $coords); } elseif ( is_array ( $ coords [ 0 ] ) && is_array ( $ coords [ 1 ] ) ) { //Maybe is a 2 points line foreach ( $ coords [ 0 ] as $ key => $ coord ) { $ coords [ 0 ] [ $ key ] = implode ( ',' , array_reverse ( $ coord ) ) ; //                    $coords[0][$key] = implode(',', $coord); } return implode ( ";" , $ coords [ 0 ] ) ; } } //If is a polygon  geometry, multiple polygons aren't supported if ( $ count == 1 && is_array ( $ coords [ 0 ] ) && count ( $ coords [ 0 ] ) >= 3 ) { foreach ( $ coords [ 0 ] as $ key => $ coord ) { $ coords [ 0 ] [ $ key ] = implode ( ',' , array_reverse ( $ coord ) ) ; //                $coords[0][$key] = implode(',', $coord); } return implode ( ";" , $ coords [ 0 ] ) ; } //Maybe is a 3 points + line: if ( $ count > 2 ) { $ first = $ coords [ 0 ] ; $ last = end ( $ coords ) ; reset ( $ coords ) ; //but just maybe, be kind with me or sugest a new function to do that. if ( is_array ( $ first ) && is_array ( $ last ) ) { foreach ( $ coords as $ key => $ coord ) { $ coords [ $ key ] = implode ( ',' , $ coord ) ; } return implode ( ";" , $ coords ) ; } } throw new \ LogicException ( "You got me! :( Please report it to https://github.com/VM9/orion-explorer-php-frame-work/issues " ) ; }
Method thats allow to convert geoJson coordinate format into Orion coords query strinng format.
@param array $coords a valid geoJson coordinate array
@return type
@throws \LogicException
Method thats allow to convert geoJson coordinate format into Orion coords query strinng format .