protected function initDirection( string $direction )
   {

      // Convert the direction to UPPER case
      $direction = \strtoupper( \trim( $direction ) );

      if ( \strlen( $direction ) != 1 )
      {
         // Bad Format
         throw new GISError(
            GISError::ERROR_TYPE_DIRECTION,
            \sprintf( "'%s' is not allowed.", $direction )
         );
      }

      if ( 'O' == $direction )
      {
         // Convert O to E
         $direction = 'E';
      }

      // Define the allowed 2 direction values
      $allowedDirections = $this->properties[ 'islatitude' ] ? array( 'N', 'S' ) : array( 'E', 'W' );

      if ( ! \in_array( $direction, $allowedDirections ) )
      {
         // Not allowed value
         throw new GISError(
            GISError::ERROR_TYPE_DIRECTION,
            \sprintf(
               "'%s' isnt allowed. Please use '%s'",
               $direction,
               \join( "' or '", $allowedDirections )
            )
         );
      }

      $this->properties[ 'direction' ] = $direction;

   }